Custom back button in UINavigationController

前端 未结 10 1820
伪装坚强ぢ
伪装坚强ぢ 2020-12-28 16:59

For an application I\'m developing, I need to display a custom back button in a navigation bar. I have the button asset as a PNG image, and I\'m writing this code:



        
10条回答
  •  执笔经年
    2020-12-28 17:52

    The backBarButtonItem property works as intended, but it will always add its standard button shape and color based on the navigation bar tint color.

    You can customize the text, but not replace the image.

    One workaround, as Andrew Pouliot suggested, is to use leftBarButtonItem instead, but I stuck to the standard button instead.

提交回复
热议问题