1

I am trying to add a UIBarButtonItem to my UINavigationController.

The button is too wide though and the hit area seems to stretch beyond the bounds of the image.

enter image description here

In my viewDidLoad I am simply applying:

let leftNavButton = UIBarButtonItem(image: #imageLiteral(resourceName: "hamburger_icon"), style: .plain, target: nil, action: nil)

navigationItem.leftBarButtonItem = leftNavButton
koen
  • 5,383
  • 7
  • 50
  • 89
Teddy K
  • 820
  • 1
  • 6
  • 17
  • 1
    Does this answer your question? [Change size of UIBarButtonItem (image) in Swift 3](https://stackoverflow.com/questions/43073738/change-size-of-uibarbuttonitem-image-in-swift-3) – nodediggity Jan 15 '20 at 21:14

1 Answers1

1

There can be a problem with an image size of hamburger_icon, try to use a random system icon to see if the image is still too wide.

John Snow
  • 77
  • 1
  • 9