gpt4 book ai didi

ios - [UIScreen mainScreen].bounds.size iOS 7 和 iOS 8 的区别

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:03:53 29 4
gpt4 key购买 nike

iOS 8 中的 UIScreen 现在是面向界面的 (Is [UIScreen mainScreen].bounds.size becoming orientation-dependent in iOS8?)。

我的应用仅在横向模式下运行——因此在 iOS 7 和 iOS 8 中,bounds.size.width 和 bounds.size.height 的值将被交换。为了支持 iOS 7 和 iOS 8,这是否意味着在我的代码中,我需要检测 iOS 的版本(或者例如将两个维度中较大的分配给我的“宽度”变量,将较短的分配给“高度'变量)?我应该补充一点,我正在以编程方式创建 View 。

最佳答案

是的,您需要以编程方式检查操作系统版本并返回适当的值。这是一种检查方法:How can we programmatically detect which iOS version is device running on? .

关于ios - [UIScreen mainScreen].bounds.size iOS 7 和 iOS 8 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25990631/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com