Custom back button in UINavigationController

前端 未结 10 1819
伪装坚强ぢ
伪装坚强ぢ 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:39

    See this answer here: How to create backBarButtomItem with custom view for a UINavigationController

    You just need to set the backBarButtonItem property on the navigationController before pushing the viewController. Setting the backBarButtonItem property in the viewController's viewDidLoad method (for example) doesn't work.

提交回复
热议问题