Change UINavigationBar Height

前端 未结 12 1558
囚心锁ツ
囚心锁ツ 2020-11-28 09:26

Can some one tell me how to change the navigation bar height?

Here is what i have so far:

CGFloat navBarHeight = 10;
self.navigationController.navi         


        
12条回答
  •  北荒
    北荒 (楼主)
    2020-11-28 09:56

    Override -(void)viewWillAppear method in the viewController and Try the code below,

    - (void)viewWillAppear {
    
    UINavigationBar *navigationBar = [[self navigationController] navigationBar];
    CGRect frame = [navigationBar frame];
    frame.size.height = 82.0f;
    [navigationBar setFrame:frame];
    }
    

提交回复
热议问题