What is wrong with size classes?

蓝咒 提交于 2019-12-24 07:39:02

问题


I have created a new project. And set a UILabel into two position depending on size classes, but wCompact, hAny can not trigger in iPhone simulator. I have set label x position to 0, but it is still on 15px as on wAny, hAny. Why? Use Size Classes is set. I am using Xcode beta 3.


回答1:


I forget to set constrains. Set size-classes have nothing to do with view's position, to position views needs only to set up constrains.




回答2:


You have missed to set the margin. I faced this issue in Xcode 6. Select constraints to margin. If you are designing for backward compatibility (that is for lower versions of iOS) the don't select constraints to margin. Just set the constraints manually by giving position values.



来源:https://stackoverflow.com/questions/25009568/what-is-wrong-with-size-classes

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