How to remove all navigationbar back button title

后端 未结 30 3391
后悔当初
后悔当初 2020-12-12 15:42

When I push a UIViewController, it has some title in back button at new UIViewController, if the title has a lot of text, It does not look good in

30条回答
  •  無奈伤痛
    2020-12-12 16:18

    Just copy this code in didFinishLaunchingWithOptions launchOptions

    Swift 5

    UIBarButtonItem.appearance().setBackButtonTitlePositionAdjustment(UIOffset(horizontal: -1000.0, vertical: 0.0), for: .default)
    

    Swift 4

    UIBarButtonItem.appearance().setBackButtonTitlePositionAdjustment(UIOffsetMake(-1000.0, 0.0), for: .default)
    

提交回复
热议问题