简体   繁体   English

界面构建器视图ui设计在横向模式下更改ios

[英]interface builder view ui design changing in landscape mode ios

i have created universal app and all view controller xib's designed for iPhone(320x460), but when it rotates to landscape the ui design totally changed, please anyone let me know how to design for landscape and same as ipad also. 我已经创建了通用应用程序,并且所有视图控制器xib专为iPhone(320x460)设计,但是当它旋转到横向时,ui设计完全改变了,请有人让我知道如何为横向设计,并且与ipad一样。

Thanks in advance, 提前致谢,

The best way to support both orientations and platforms (iPhone & iPad) is to use AutoLayout. 同时支持方向和平台(iPhone和iPad)的最佳方法是使用AutoLayout。 Here's a good introduction on Apple Developer website : 这是Apple Developer 网站上的好介绍:

Auto Layout is a system that lets you lay out your app's user interface by creating a mathematical description of the relationships between the elements. 自动版式是一个系统,可让您通过创建元素之间关系的数学描述来布局应用程序的用户界面。 You define these relationships in terms of constraints either on individual elements, or between sets of elements. 您可以根据对单个元素或元素集之间的约束来定义这些关系。 Using Auto Layout, you can create a dynamic and versatile interface that responds appropriately to changes in screen size, device orientation, and localisation. 使用“自动布局”,您可以创建一个动态且通用的界面,以对屏幕尺寸,设备方向和本地化的更改做出适当的响应。

Also, check out WWDC sessions on AutoLayout. 另外,在AutoLayout上签出WWDC会话。

I would also suggest you learning Autolayout for configuring same view for different orientations and devices but only when the design is really complex and cant be solved using the Spring and Struts Model. 我还建议您学习自动布局,以便为不同的方向和设备配置相同的视图,但是仅当设计非常复杂且无法使用Spring and Struts模型解决时才可以使用。 Autolayout sometimes is a real pain. 有时,自动Autolayout确实很痛苦。

If your design is simple, you can sort out many of your views simply using the Spring and Struts model(Autoresizing) and you don't need Autolayout or drawing separate Stroyboard files and nibs. 如果您的设计简单,则可以使用Spring和Struts模型(自动调整大小)简单地整理出许多视图,并且不需要“自动Autolayout或绘制单独的Stroyboard文件和笔尖。

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

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