Change font of back navigation bar button

前端 未结 7 1129
走了就别回头了
走了就别回头了 2020-12-04 17:38

I want to be able to set the font of my apps navigation bar back button without doing anything too crazy and without losing any other design characteristics of the button (i

7条回答
  •  日久生厌
    2020-12-04 18:19

    Swift version of the all mentioned above (excerpt from the original answer) :

    let customFont = UIFont(name: "customFontName", size: 17.0)!
    UIBarButtonItem.appearance().setTitleTextAttributes([NSFontAttributeName: customFont], forState: .normal)
    

    More goodies:
    https://stackoverflow.com/a/28347428/469614

提交回复
热议问题