我正在使用以下代码来显示屏幕/视图控制器.
SearchParams *nxt=[[SearchParams alloc] initWithNibName:@"SearchParams" bundle:nil]; UINavigationController *nvc=[[UINavigationController alloc] initWithRootViewController:nxt]; nvc.modalPresentationStyle=UIModalPresentationFormSheet; [self.preLCtr.preCinescape_iPadViewController presentModalViewController:nvc animated:YES];
我不确定PesentationSheet的大小.我试图截取屏幕截图取尺寸/尺寸.但它不是确切的解决方案.
问题:iPad中Present-Modal-Sheet的确切大小是多少?
解决方法
根据Apple的
documentation,尺寸可能会根据可用的屏幕尺寸而改变:
The width and height of the presented view are smaller than those of the screen and the view is centered on the screen. If the device is in a landscape orientation and the keyboard is visible,the position of the view is adjusted upward so that the view remains visible. All uncovered areas are dimmed to prevent the user from interacting with them.
也许在加载到FormSheet的viewcontroller中,您可以使用以下命令在运行时确定视图大小:self.view.bounds;
如果你需要调整FormSheet的大小,我在stackoverflow看到了一些答案