![我正在开发一个 iPad 应用程序,我必须将表格 View 显示为表单,当我单击表格中的单元格时,表单应调整大小][1]
这段代码是我写的
-(void)viewWillAppear:(BOOL)animated
{
self.view.superview.bounds = CGRectMake(0, 0, 290, 620);
}
当单击一个单元格时,我在索引路径中的 did select row 中写入了 self.view.superview.bounds = CGRectMake(0, 0, 600, 620);
....有时表单不显示在中心。我哪里错了。有没有其他方法来实现这种行为
最佳答案
在 iOS 7 中,您无法再调整模态呈现的 View Controller 的大小。
您想要使用 UIModalPresentationStyleCustom
模式,然后使用 iOS 7+ 中提供的新 API 提供您自己的自定义过渡
请参阅以下链接了解更多信息:
http://www.objc.io/issue-5/view-controller-transitions.html
http://www.teehanlax.com/blog/custom-uiviewcontroller-transitions/
http://objectivetoast.com/2014/03/17/custom-transitions-on-ios/
关于objective-c - 模态视图 Controller 未显示在中心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24611036/