IOS 5 How to change the color of back button in a navigation bar?

后端 未结 5 1365
感动是毒
感动是毒 2020-12-28 09:09

I want to change the color of back button of a navigation bar to make it look like this\"enter

5条回答
  •  一生所求
    2020-12-28 09:26

    Set the backBarButtonItem's tintColor:

    self.navigationItem.backBarButtonItem.tintColor = [UIColor redColor];
    

    TIP: If you want this to be applied to all UIBarButtonItem instances in your application by default, then you can use the new UIAppearance API to do just that:

    [[UIBarButtonItem appearance] setTintColor:[UIColor redColor]];
    

提交回复
热议问题