ios7狀態欄不覆蓋列表頁

今天在做一個隱藏導航欄的頁面,由於之前沒有用xib,發現我在view controller添加的tableview的內容範圍出現在了statusbar的下方。就是tableview的contentInset莫名其妙的多了一個top 20(說好的覆蓋呢。。),於是乎列表的滾動範圍就跑到狀態欄下面了。查了半天原因發現ios7的tableview多了一個automaticallyAdjustsScrollViewInsets屬性。看了下文檔說的很清楚的:


automaticallyAdjustsScrollViewInsets

Specifies whether or not the view controller should automatically adjust its scroll view insets.

@property(nonatomic, assign) BOOL automaticallyAdjustsScrollViewInsets

Discussion

Default value is YES, which allows the view controller to adjust its scroll view insets in response to the screen areas consumed by the status bar, navigation bar, and toolbar or tab bar. Set to NO if you want to manage scroll view inset adjustments yourself, such as when there is more than one scroll view in the view hierarchy.

Availability

  • Available in iOS 7.0 and later.

Declared In

UIViewController.h

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章