[英]How can I tell if a Springs and Struts app is scaling in the iPhone 6 simulator?
I have a couple applications built pre-auto-layout (but w/ Springs and Struts to support iPhone 5+) that I'm trying out in the iPhone 6 and 6 Plus simulator and they actually look quite good. 我有几个在自动布局前构建的应用程序(但带有Springs和Struts以支持iPhone 5+),我正在iPhone 6和6 Plus模拟器中进行了尝试,它们看起来确实不错。 However, I can't tell if the Springs and Struts are actually doing their job so-to-speak or if they're just being scaled.
但是,我无法确定Springs和Struts是否确实在做他们所说的工作,或者只是在扩展规模。 There must be some obvious thing I'm missing where it says which?
肯定有一些明显的东西我想念在哪儿? Also, do auto-layout apps just automatically convert when recompiled with the latest SDK for iPhone 6 so they're not just scaling as long as 3X artwork is provided (in the case of 6 Plus)?
另外,自动布局应用程序在与最新的iPhone 6 SDK一起重新编译时是否会自动转换,因此它们不仅可以缩放,只要提供3倍的图稿(在6 Plus的情况下)?
Use a different launch image for iPhone 6, iPhone 6 Plus and all the rest. 为iPhone 6,iPhone 6 Plus和其他所有产品使用不同的启动图像。 If you see a specific lunch image you know your app is not scaled and that it is running in the device's native resolution.
如果您看到特定的午餐图像,则说明您的应用未缩放,并且正在以设备的本机分辨率运行。
You can easily see, if your app runs in scaled mode by outputting the bounds and the native bounds screen of the main screen: 通过输出边界和主屏幕的本机边界屏幕,可以轻松查看您的应用程序是否以缩放模式运行:
println("bounds = \(UIScreen.mainScreen().bounds)")
println("nativeBounds = \(UIScreen.mainScreen().nativeBounds)")
Without a designated launch images the output of the iPhone 6 Plus Simulator is: 没有指定的启动图像,iPhone 6 Plus Simulator的输出为:
bounds = (0.0,0.0,320.0,480.0)
nativeBounds = (0.0,0.0,960.0,1440.0)
The native bounds are 3 times the scaled bounds. 原始边界是缩放边界的3倍。 This is the reason behind the @3x display.scale.
这就是@ 3x display.scale背后的原因。
In case of the iPhone 6 Plus nativeScale
also helps: 如果使用iPhone 6 Plus,
nativeScale
还可以帮助:
println("main screen native scale = \(UIScreen.mainScreen().nativeScale)")
println("main screen scale = \(UIScreen.mainScreen().scale)")
nativeScale
will always be 3.0
. nativeScale
将始终为3.0
。 scale
will be 2.0
if the simulator does scaling. 如果模拟器进行缩放,则
scale
将为2.0
。
To get a comprehensive understanding of the new resolutions see this great blog entry: http://www.paintcodeapp.com/news/iphone-6-screens-demystified 要全面了解新决议,请访问以下出色的博客文章: http : //www.paintcodeapp.com/news/iphone-6-screens-demystified
The only way I was able to tell was to go home and see if the status bar text was smaller than it was in my app. 我唯一能告诉我的方法是回家,看看状态栏文本是否比我的应用程序中的文本小。 A smaller home screen status bar implies it is being scaled.
较小的主屏幕状态栏表示正在缩放。 If the status bar text is the same size within your app in the iPhone 6 sim as it is on the home screen of the simulator, then it is using your springs/struts or autolayout instead of scaling
如果状态栏文本在iPhone 6 sim中的应用程序中的大小与模拟器主屏幕上的大小相同,则表明它是使用弹簧/支柱或自动布局而不是缩放
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.