Why does UIViewController extend under UINavigationBar, while UITableViewController doesn't?

前端 未结 3 629
庸人自扰
庸人自扰 2020-12-07 12:55

I have UITabbarController with UINavigationController in it. I have a subclass of UIView that I assign as the view of

3条回答
  •  被撕碎了的回忆
    2020-12-07 13:35

    By default, UITableViewController's views are automatically inset in iOS7 so that they don't start below the navigation bar/status bar. This is controller by the "Adjust scroll view insets" setting on the Attributes Inspector tab of the UITableViewController in Interface Builder, or by the setAutomaticallyAdjustsScrollViewInsets: method of UIViewController.

    For a UIViewController's contents, if you don't want its view's contents to extend under the top/bottom bars, you can use the Extend Edges Under Top Bars/Under Bottom Bars settings in Interface Builder. This is accessible via the edgesForExtendedLayout property.

提交回复
热议问题