2014-12-06 41 views
8

还有就是UIView一个新的属性:在iOS8上layoutMargin的UIView layoutMargins在Interface Builder

为了设置视图编程的边缘:

self.view.layoutMargins = UIEdgeInsetsMake(0, 0, 10, 10); 

是否有可能设置页边距在Interface Builder?

+0

这个答案可以帮助你:http://stackoverflow.com/a/25261327/1728118 Z. – 2015-02-05 18:52:55

+0

我也不能找到一种方法。 :( – livingtech 2015-05-05 15:42:56

+2

为什么不使用IBInspectable属性?添加字段(上,左,下,右堂妹插图尚不支持),新扩展的UIViewController和值IB – HotJard 2015-09-05 15:34:48

回答

4

这可以通过在Identity Inspector设置User Defined Runtime Attribute来实现:

screenshot 1

虽然Xcode中确实有边距设置为7.3 (7D175),但它仍然没有任何效果,所以你必须使用用户定义的属性:

screenshot 2