This question already has an answer here:
I am using custom image for navigation bar button.In iOS 6,if we set the left bar button item with button,its x value starts from 10px. But in iOS 7,if we do the same thing,x value of button starts at 20px. Is there any way we shall make it start from 10px as the buttons appearance is not so good with that in iOS 7?
Add button as navigation item in ios7 as below
No, you can't change the
UIBarButtonItem
frame. Instead, subclassUINavigationBar
.UIBarButtonItems can be initialized using initWithCustomView: method. So you can create some custom view (in your case navigation bar button item with custom image) and initialize bar button item with that custom view. Example:
You can set any frame you want in initWithImage: method of CustomView:
In this way it is possible to change frame of UIBarButtonItem.