iOS 8 Autolayout with Size Classes

 ̄綄美尐妖づ 提交于 2019-12-25 14:58:10

问题


This is driving me crazy. All I need is to align the subview to superview & fill its bounds. To do this, all I used to do is create 4 Autolayout constraints for subview in storyboard and set top, left, bottom, right margins to 0 relative to subview. But in Xcode 6, with Size classes enabled, the left and right margins default to -16 and setting them to 0 has no effect. No matter what I do, the subview never fills superview bounds and there are few pixel gaps on the left and right. How do I get around it ?

FYI: This happens on iPhone 6+/iPad Air simulators.


回答1:


Hope this will solve all your issues related to customised edge to edge issue. I've highlighted the area from which you need to remove check mark.

Make sure if you are using auto layout then check pin is set to zero for all edges and constraints to margin is unchecked.

please remove checkmark from pin when adding constraints to view from super view. By default it will -16 even if you set it to 0.



来源:https://stackoverflow.com/questions/26816569/ios-8-autolayout-with-size-classes

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