Best way to change XIB files based on rotation? [closed]

前提是你 提交于 2019-12-10 12:33:29

问题


My app has so far just been a portrait-based application. However, I am adding landscape mode to a new version, but have found that my XIB files look shocking when rotated from portrait to landscape. Apparently I need to make a landscape version of each XIB and use some code to change with XIB launches based on what rotation occurs. Am I right? If so, where do I go from here? Are there any Apple sample apps utilising this code?

FYI - My XIB files just have text in them.

Thanks.


回答1:


If you have a complex view, the automatic resizing may not work well enough. If so, your best bet is to have separate views loaded from separate nibs for each orientation.

To set this up, see here: Easiest way to support multiple orientations? How do I load a custom NIB when the application is in Landscape?



来源:https://stackoverflow.com/questions/2498558/best-way-to-change-xib-files-based-on-rotation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!