简体   繁体   English

如何确定Springs and Struts应用程序是否正在iPhone 6模拟器中扩展?

[英]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.

相关问题 为什么应用程序在iPhone模拟器中崩溃? 我怎样才能解决这个问题? - Why is app crashing in iPhone simulator; how can I fix this? 如何在 Mac 上的 iPhone 模拟器上运行 ElectronJS 应用程序? - How can I run ElectronJS app on iPhone Simulator on a Mac? 如何以编程方式确定我的应用程序是否在 iphone 模拟器中运行? - How can I programmatically determine if my app is running in the iphone simulator? iOS模拟器-如何将默认模拟器设为iPhone - iOS simulator - How can I make default simulator as iPhone 在 Xcode iOS 模拟器中,我如何知道它正在模拟什么设备? - In the Xcode iOS simulator, how can I tell what device it is simulating? 如何在iPhone模拟器文件夹下找到我的应用程序文件? - How can I find my app files under iPhone Simulator folder? 如何从模拟器录制iPhone应用程序的视频? - How do I record a video of my iPhone app from the simulator? iPhone模拟器 - 如何检测应用程序何时在模拟器上运行(这样可以设置测试数据)? - iPhone simulator - how to detect when app is running on simulator (so can setup test data)? 如何在iPhone Xs模拟器上启用到Siri的文本输入? - How can I enable text input to Siri on the iPhone Xs simulator? 我怎么知道我的iPhone模拟器的IP地址? - How can I know the IP address of my iPhone simulator?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM