[英]How to get iPad screen size in different orientations?
我正在编写我的第一个iPad应用程序。 我遇到的第一个问题是屏幕在不同方向上的尺寸。
当我尝试使用这两个时:
view.frame
要么
view.bounds
我得到了人像模式的屏幕分辨率。 请注意,我需要大和微型iPad屏幕尺寸。 我也尝试过使用mainScreen,但得到的结果与上述代码相同。
干得好
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
CGFloat width = CGRectGetWidth(self.view.bounds);
}
如果有帮助,请标记为答案/投票。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.