Change size of UIBarButtonItem (image) in Swift 3

前端 未结 6 2046
没有蜡笔的小新
没有蜡笔的小新 2020-12-14 07:51

I am trying to change the size of some icons in my navBar, but I am a little confused as to how to do this? My code so far is:

func setUpNavBarButtons() {
          


        
6条回答
  •  隐瞒了意图╮
    2020-12-14 08:46

    You can configure the bar buttons using this function:

    public convenience init(customView: UIView)
    

    And You can init the custom view as You desire. After that You can access the view if needed via UIBarButtonItem's:

    open var customView: UIView?
    

    Hint: Because UIButton is a child class of UIView, You can directly use it too.

提交回复
热议问题