那么,如果在表视图中的自定义原型单元内打开故事板时,如何正确使用情节提要设置弹出框?
我认为最优雅的解决方案如下:
像往常一样从按钮创建一个序列到适当的ViewController
打开segue并将锚点设置为表格视图(从圆圈拖动到视图)。
在准备segue时,添加以下内容:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
UIViewController *vc = (UIViewController *)segue.destinationViewController;
UIPopoverPresentationController *ppc = vc.popoverPresentationController;
UIButton *button = (UIButton *)sender;
ppc.sourceRect = button.frame;
ppc.sourceView = button.superview;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句