CGfloat wIDth = [UIScreen mainScreen].bounds.size.wIDth - 100;@H_403_12@但它的纵向和横向宽度为“668.0”.
解决方法 我遇到了和你一样的问题,我找到的就是检查方向并计算高度和宽度,如下所示:
如何根据设备的方向获得不同的宽度.UIInterfaceOrIEntation orIEntation = [[UIApplication sharedApplication] statusbarOrIEntation];screenHeight = orIEntation == UIInterfaceOrIEntationLandscapeleft || orIEntation == UIInterfaceOrIEntationLandscapeRight ? 748 : 1004;screenWIDth = orIEntation == UIInterfaceOrIEntationLandscapeleft || orIEntation == UIInterfaceOrIEntationLandscapeRight ? 1024 : 768;@H_403_12@这些尺寸适用于iPad显而易见,但它可以适用于尺寸合适的iPhone.
我个人觉得它有点差,但我找不到别的东西.
总结以上是内存溢出为你收集整理的iPad – 以纵向和横向获取屏幕尺寸全部内容,希望文章能够帮你解决iPad – 以纵向和横向获取屏幕尺寸所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
赞
(0)
打赏
微信扫一扫
支付宝扫一扫
![微信扫一扫](/view/img/theme/weipay.png)
![支付宝扫一扫](/view/img/theme/alipay.png)
iphone – 切换后台任务时SIGPIPE崩溃
上一篇
2022-05-27
Linux下多块网卡同一网段连通配置
下一篇
2022-05-27
评论列表(0条)