How to set font & color of the title in UINavigationBar using iOS5 appearance API?

后端 未结 7 1292
北恋
北恋 2020-12-04 10:50

I have a multiple View Controllers and I want to set the font color of all to red.

 [[UINavigationBar appearance] setFont:[UIFont boldSystemFontOfSize:12.0]]         


        
相关标签:
7条回答
  • 2020-12-04 11:45

    Use this line of code

    UILabel *badge_Label=[[UILabel alloc]initWithFrame:CGRectMake(5,3, 15, 15)];
    badge_Label.backgroundColor=[UIColor redcolor];
    badge_Label.font=[UIFont systemFontOfSize:12];
    [badge_Label setText:@"20"];
    [self.navigationController.navigationBar addSubview:badgelabel];
    

    I think this will be helpful for you.

    0 讨论(0)
提交回复
热议问题