Laying out & sizing of subviews in a UIViewController

前端 未结 2 1201
醉酒成梦
醉酒成梦 2020-12-07 16:17

I have an app with with a UITabController and each tab is a UINavigationController. The root of one of my UINavigationControllers is a

2条回答
  •  無奈伤痛
    2020-12-07 17:05

    You can do your layout logic inside the viewWillLayoutSubviews of the UIViewController.

    -(void)viewWillLayoutSubviews{
        [super viewWillLayoutSubviews];
        // Your layout logic here
    }
    

    DOC: Called just before the view controller's view's layoutSubviews method is invoked. Subclasses can implement as necessary. The default is a nop.

提交回复
热议问题