is it possible to design view for iPad without autolayout?

爱⌒轻易说出口 提交于 2019-12-12 05:49:19

问题


I have developed app without autolayout for iPhone. Now I need that app for iPad also. Is it possible to create it without autolayout?


回答1:


yes, you have to create App directly then select iPad. and using Auto Resize ,you can directly develop app for iPad only.

I have attached few Screen shot, may be helpful to you.

Create new project, using XIB .




回答2:


I don't recommend that (see comment of @Nimit Parekh).

You can use Sized classes to avoid having 2 separate Storyboards - one for iPhone and other for iPad. There is a good tutorial.

Second option is to have 2 storyboards. You only need to link all outlets from the 1st storyboard to the second. You have to check not to miss something, otherwise you can get exceptions in iPad.

The 3rd option is manually (from the code) to manage layout for iPad - but this will create a lot of specific code for iPad only (you have to check what type is your device and split code) - this is not recommended.

Take into account that Autolayout is more easy to apply on iPad (from my point of view) because of equal withd / height ratio for iPad - it is the same up to now. Not like in iPhone.



来源:https://stackoverflow.com/questions/32046612/is-it-possible-to-design-view-for-ipad-without-autolayout

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