gpt4 book ai didi

swift/iOS 9 : using Popover Presentation with a UITableViewCell

转载 作者:行者123 更新时间:2023-11-28 06:56:34 25 4
gpt4 key购买 nike

我不断收到此错误,因为我无法正确锚定我的 segue。我尝试过混合使用 Storyboard和编码。

enter image description here enter image description here

我是 iOS 的新手,所以我一直试图通过查看 this solution 来解决这个问题,但没有成功。 ,以及 Youtube 视频。任何帮助将不胜感激!

最佳答案

根据我的经验,以编程方式执行此操作并完全忘记 segue/ Storyboard会更容易。

这适用于 swift 2.0

func showPopOverBox(button:UIButton) {
let popoverViewController = self.storyboard?.instantiateViewControllerWithIdentifier("yourviewcontrollerstoryboardId") as UIViewController!
popoverViewController.modalPresentationStyle = .Popover
popoverViewController.preferredContentSize = CGSizeMake(600, 600)

let popoverPresentationViewController = popoverViewController.popoverPresentationController

popoverPresentationViewController?.permittedArrowDirections = UIPopoverArrowDirection.Any
popoverPresentationViewController?.sourceView = button
popoverPresentationViewController?.sourceRect = button.bounds

presentViewController(popoverViewController, animated: true, completion: nil)

}

关于 swift/iOS 9 : using Popover Presentation with a UITableViewCell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33454770/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com