Set custom images to the UIBarButtonItem but it doesn't show any image

后端 未结 2 799
无人共我
无人共我 2020-12-02 02:27

I want to set custom images to the UIBarButtonItem but it only shows a rectangular box around and It doesn\'t show the actual image.

func setupBrowserToolbar         


        
2条回答
  •  时光取名叫无心
    2020-12-02 03:05

    Swift 3 , 4 update

    From swift 3, the method is changed to the following format

    UIImage(named:"yourImageName")!.withRenderingMode(.alwaysOriginal)
    

提交回复
热议问题