简体   繁体   English

ios swift-UI Designer自适应iPhone布局

[英]ios swift - UI Designer Adaptive iPhone Layout

I've disabled size classes in my project and have 3 view controllers. 我在项目中禁用了大小类,并具有3个视图控制器。

By looking at the preview of each of the view controllers, I've noticed that the iPhone 6 which is the one I've been running the application on shows a layout completely different than how it looks when you run it on the actual phone. 通过查看每个视图控制器的预览,我注意到我一直在运行该应用程序的iPhone 6的布局与在实际手机上运行时的外观完全不同。

I'm trying to build an application with size classes disabled that will have an adaptive layout between iPhones. 我正在尝试构建一个禁用大小类的应用程序,该类将在iPhone之间具有自适应布局。 I was under the impression that size classes was geared towards adaptivity between iPhone and iPad applications? 我给人的印象是,尺寸类别是为了适应iPhone和iPad应用程序之间的适应性?

My app looks good on the iPhone 6 and terrible on the 6 plus. 我的应用在iPhone 6上看起来不错,在6 plus上也很糟糕。 I would like the layout to be adaptive between both iPhones. 我希望布局在两部iPhone之间都可以适应。 Any advice? 有什么建议吗?

Thank you 谢谢

PS: Using autolayout PS:使用自动版式

First of all enable Size classes. 首先启用Size类。 This is how you can vary the changes for 6 and 6+. 这是您如何改变6和6+的更改。 If you want the similar layout on both the devices then use 600x600 size. 如果要在两个设备上使用相似的布局,请使用600x600尺寸。 If you want different layout in 6 and 6+ then you have to switch the size class and change the constraints accordingly. 如果要在6和6+中使用不同的布局,则必须切换尺寸类别并相应地更改约束。 Refer this link for tutorial: https://www.raywenderlich.com/113768/adaptive-layout-tutorial-in-ios-9-getting-started 请参考此链接以获取教程: https : //www.raywenderlich.com/113768/adaptive-layout-tutorial-in-ios-9-getting-started

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM