Search code examples
iosviewwillappearviewdidappear

The operation between viewWillAppear and viewDidAppear?


I change the navigationBar's height in the method viewWillAppear In first time, it works and the bar‘s height isn't changed. But when I push again, the bar's height change to 44

if I change the bar's height in viewWillAppear and viewDidAppear, it works and isn't changed

So, Is not a system between these two methods to do what action?


Solution

  • If you want change navigationbar's height you must hide navigationController.navigationBar and add new UINavigationBar to your controller. And add new UIBarButton (with title "Back") to newNavigationBar.leftBarBarItem.

    Also you can add any UIView instead newNavigationBar