set custom back bar button universally with no title

前端 未结 6 1270
暖寄归人
暖寄归人 2021-01-03 02:36

I want to set custom back bar button for all controllers in the app. I tried using this:

[[UIBarButtonItem appearance] setBackButtonBackgroundImage:backB

6条回答
  •  甜味超标
    2021-01-03 03:15

    I've had a similar problem before and I've searched everywhere for a solution.

    The only one I've found, which works for your problem was to implement in EVERY view controller a UILeftBarButton which does the popping.

    You can change the background image the way you're doing, but if you set the text to nil or empty text (""), you're button just won't show up.

    You also can't change the View of the UIBackBarButton, only it's text (so no custom button).

提交回复
热议问题