how to disable auto layout by default for xcode 4.5?

时光毁灭记忆、已成空白 提交于 2019-12-20 14:17:32

问题


A question here: Xcode 4.5 corrupting XIBs? illustrates the problem and solution for xcode 4.5 creating nib files that can not run on ios5.

Does anyone have a solution to prevent the auto layout checkbox from being defaulted to on? I'm worried that in the process of development, I will forget to unchecked that box.


回答1:


There's a way, but it's kinda convoluted and, I might add, not recommended.

You can open your template files located in:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates/User Interface/, in each directory, there are .xib files. They are XML files, open them with a text editor.

Replace the following line:

<bool key="IBDocument.UseAutolayout">YES</bool>

to

<bool key="IBDocument.UseAutolayout">NO</bool>

I will repeat though, this is not recommended.




回答2:


There is a project templates folder, you should modify the xib files there too.

Also if you want to disable auto layout in storyboards, you should change this attribute:

useAutolayout="YES"

in each storyboard file to NO.



来源:https://stackoverflow.com/questions/12716891/how-to-disable-auto-layout-by-default-for-xcode-4-5

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