1

I want to resize an image in a UIBarButtonItem.

(I'm not setting a customView and using a UIImageView, just setting the image property of the UIBarButtonItem).

Image Insets seem not working for the width of the image.

Top and Bottom do they work, but left and right don't.

I've also tried to change the width of the Bar Button Item.

enter image description here

aneuryzm
  • 63,052
  • 100
  • 273
  • 488
  • i would usually add a UIButton inside the UIBarButtonItem. this way you will have all the good properties UIButton contain. – Mohammadalijf Feb 28 '17 at 09:45
  • @Mohammadalijf yes I understand, but that's more work. I was wondering why there are left and right insets fields in Interface Builder if they don't work. – aneuryzm Feb 28 '17 at 09:47
  • i don't know i guess it inherits these designable properties from it's super class. you can easily add UIButton to UIBarButtonItem from story board. just drag a uibutton on navigation bar in stroyboard – Mohammadalijf Feb 28 '17 at 09:56
  • @Mohammadalijf I see.. I will use a UIButton, although it seems stupid to me that the UIBarButtonItem image resizes only vertically. – aneuryzm Feb 28 '17 at 10:10

0 Answers0