iOS 7 Changing UINavigationBar titleView alpha

后端 未结 3 2036
无人共我
无人共我 2021-01-06 09:10

So I am using the UINavigationBar component of iOS7, but not the UINavigationController itself. When I push a new view with my custom navigation controller, I want to change

3条回答
  •  醉酒成梦
    2021-01-06 09:27

    You can try this one -

    [self.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                                        [UIColor colorWithRed:125/255.0 green:178/255.0 blue:15/255.0 alpha:0.2],
                                                                        NSForegroundColorAttributeName,
                                                                        [UIFont fontWithName:@"Helvetica-Bold" size:16.0],
                                                                        NSFontAttributeName,
                                                                         nil]];
    

    If you just want to change the title attributes. Or this one to change bar alpha :

    [self.navigationBar setBarTintColor:[UIColor colorWithRed:125/255.0 green:178/255.0 blue:15/255.0 alpha:0.2]];
    

提交回复
热议问题