iOS 8的自动布局与大小级 [英] iOS 8 Autolayout with Size Classes

查看:135
本文介绍了iOS 8的自动布局与大小级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是推动我疯了。所有我需要的是对准子视图上海华&安培;填补其边界。要做到这一点,所有我曾经做的是创建在故事板子视图,并设置上,左,下,右页边距4自动布局约束,以0相对于子视图。但在X code 6,大小为类启用后,左,右页边距默认为-16,并将其设置为0,没有任何效果。无论我做什么,子视图从来没有填补上海华界,有在左,右几个像素的空白。我如何围绕它得到什么?

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:这发生在iPhone 6 + / iPad的航空模拟器

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

推荐答案

希望这将解决你的所有与定制边到边的问题的问题。
我已经强调了,你需要删除复选标记的区域。

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.

请从管脚添加约束时,从超级视图来查看删除复选标记。默认情况下,将-16,即使你把它设置为0。

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.

这篇关于iOS 8的自动布局与大小级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆