0

Whenever I try to set an image to a UIBarButtonItem, it gets put in the center of the bar. How can I move it to the left to use it as a menu button by setting the image of the button programmatically? enter image description here

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Aditya Naik
  • 27
  • 1
  • 6

2 Answers2

0

Set the left bar button image via your Navigation Controller in your storyboard instead.

Click on your Navigation Controller in Storyboard and ensure Navigation Bar is selected.

Click on your Navigation Controller in Storyboard and ensure Navigation Bar is selected

Choose your image for both Back and Back mask.

Choose your back button image for both Back and Back mask

Community
  • 1
  • 1
elarcoiris
  • 1,914
  • 4
  • 28
  • 30
0

It can be fit to left of the NavigationBar button by "decreasing the resolution of image".

Aditya Naik
  • 27
  • 1
  • 6