ios – iPad中UIModalPresentationFormSheet的确切大小是多少

我正在使用以下代码显示屏幕/视图控制器.
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看到了一些答案

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...