Change color of Back button in navigation bar

后端 未结 26 2192
孤街浪徒
孤街浪徒 2020-12-02 05:58

I am trying to change the color of the Settings button to white, but can\'t get it to change.

I\'ve tried both of these:

navigationItem.leftBarButton         


        
26条回答
  •  执笔经年
    2020-12-02 06:15

    In Swift 4, you can take care of this issue using:

    let navStyles = UINavigationBar.appearance()
    // This will set the color of the text for the back buttons.
    navStyles.tintColor = .white
    // This will set the background color for navBar
    navStyles.barTintColor = .black
    

提交回复
热议问题