Issue in designing layout for iPad & iPhone?

感情迁移 提交于 2019-12-25 04:33:57

问题


I have developed an app which should support both iPhone & iPad. I have designed screens using xocde 6 with autolayout. But the issue is, screens of my app looks good for iPhone but not for iPad. I have gone through This Link

It says we should use size class for iPad & design our UI for iPad. So should i use separate size class for iPad? Doing this i will again have to design the UI for iPad. So is it the best way of designing screen using auotlayout?


回答1:


If you don't want to use size class then there is a way that your screens may look good in both devices. Obviously you need to redesign the screens. If you change some of your constraints to Aspect Ratio and ProportionalWidth and ProportionalHeight and you can fix them for both devices. Suppose there is a view in the middle of controller and you want to view proper in both device then you need to add CenterX to superview, CenterY to superview, ProportionalWidth to superview and ProportionalHeight to superview. And it will look perfect in both devices. If you need further suggestion in any situation then edit your question and i will tell you which constraint you should use to look the screen proper in both devices. Thanks.




回答2:


Yes you must do your layout independently for phone and tablet using the size class selector. A layout that works for a phone is highly unlikely to also work for tablet, or indeed iPhone 5 versus iPhone 4/6.

You may similarly need to also do landscape and portrait layouts using the size class selector if it makes sense to your project.

Try this site for great tutorials on all things iOS, including adaptive layouts.



来源:https://stackoverflow.com/questions/31156747/issue-in-designing-layout-for-ipad-iphone

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