iOS7 導航欄,view適配

iOS7 導航欄,view適配

導航控制器的navigationBar.barStyle = UIBarStyleBlack後,導航欄默認透明。
爲了達到全屏效果,官方爲控制器增加了幾個屬性:

@property(nonatomic,assign) UIRectEdge edgesForExtendedLayout NS_AVAILABLE_IOS(7_0);
//Defaults to UIRectEdgeAll,edgesForExtendedLayout指上下左右邊緣自適應來填滿整個屏幕。
self.edgesForExtendedLayout = UIRectEdgeNone;
//進行以上設置後,控制器的原點座標在導航欄的左下角。
@property(nonatomic,assign) BOOL automaticallyAdjustsScrollViewInsets NS_AVAILABLE_IOS(7_0);
//Defaults to YES.
@property(nonatomic,assign) BOOL extendedLayoutIncludesOpaqueBars;
//Defaults to NO, but bars are translucent by default on 7_0.

這三個屬性會影響view的contentOffset、contentInset、contentSize等。

發佈了29 篇原創文章 · 獲贊 6 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章