ios - 加载表单演示文稿的模态视图的自定义大小

标签 ios objective-c ipad uipresentationcontroller

我正在尝试在 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/

相关文章:

ios - 如何将NSArray保存到xml

objective-c - 滚动图像的 View

iphone - iAds : How can I prevent my AdBannerView delegate from getting called after the view has been released?

iphone - iPad/iPhone 上的 CSS 提交按钮呈现怪异

ios - iOS中拦截网络数据包

ios - 从 iPhone 传递字符串

ios - NSMutable 字符串问题

ios - 设置状态栏?

iphone - 有没有非私有(private) API 替代方案?

ios - iPad 导航 Controller 工具栏位置