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

前端 未结 3 601
庸人自扰
庸人自扰 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条回答
  •  -上瘾入骨i
    2020-12-07 13:35

    Objective-C:

    - (void)viewDidLoad {
        [super viewDidLoad];
        self.edgesForExtendedLayout = UIRectEdgeNone;
     }
    

    Swift 2:

    self.edgesForExtendedLayout = UIRectEdge.None
    

    Swift 3+:

    self.edgesForExtendedLayout = []
    

提交回复
热议问题