2014-12-06 40 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