Change iPhone navigation bar's height

前端 未结 6 365
栀梦
栀梦 2020-12-01 09:56

My client can\'t read iPhone\'s default fonts, the size is too small. I have an application with a navigation bar and I need to make everything in it bigger, for example, th

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-01 10:26

    To add to Skela's answer:

    If you initiate your navigation controller in the Storyboard you can change the class of your UINavigationBar in the storyboard to your custom navbar.

    and then implement the change height in the class

    @interface MyNavigationBar : UINavigationBar
    @end
    
    @implementation SwitchAssessmentNavigationBar
    
    - (CGSize)sizeThatFits:(CGSize)size
    {
            CGSize s = [super sizeThatFits:size];
            s.height = 200; // Or some other height
            return s;
    }
    
    @end
    

提交回复
热议问题