How can I move UIBarButtonItem as image to the left side using it as menu button?

159 Views Asked by At

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

2

There are 2 best solutions below

0
elarcoiris On

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

0
Aditya Naik On

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