我正在尝试在 iPad 中加载带有表单表演示文稿的 UIViewController。问题是这个新 View 的大小,我将大小值放在 IBuilder 中,但模态视图采用固定值。
我也尝试像这样在 prepareForSegue 中做这个:
HelpViewController *viewController = segue.destinationViewController;
viewController.view.superview.frame = CGRectMake(0, 0, 200, 200);
但是不工作,有什么帮助吗?谢谢!
最佳答案
对于 iOS 8,使用:
self.preferredContentSize = CGSizeMake(width, height);
我把它放在 viewDidLoad
中。
swift 3
self.preferredContentSize = CGSize(width: 100, height: 100)
关于ios - 加载表单演示文稿的模态视图的自定义大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16518175/