![](/img/trans.png)
[英]The detail view of a UISplitViewController takes full screen only on iOS8
[英]iOS8 Full Screen View is cut off
在iOS7中,我可以使用以下代码创建全屏视图:
- (void)loadView {
CGSize screenSize = [UIScreen mainScreen].bounds.size;
CGRect frame = CGRectMake(0, 0, screenSize.height, screenSize.width);
UIView *view = [[UIView alloc] initWithFrame: frame];
self.view = view;
}
移至iOS8时,此代码无法正常工作,屏幕被切开并在右侧缩放,类似于:
--------------- ---------------
| | | | |
| iOS7 | | iOS8 | |
| Full Screen | | Cut Off | |
| | | | |
| | | | |
--------------- ---------------
这会影响我的应用程序中以编程方式生成的所有全屏视图,这里有什么想法吗?
代替:
CGRect frame = CGRectMake(0, 0, screenSize.height, screenSize.width);
你需要
CGRect frame = CGRectMake(0, 0, screenSize.width, screenSize.height);
它的:
CGRect CGRectMake ( CGFloat x, CGFloat y, CGFloat width, CGFloat height );
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.