Shifting backButtonImage horizontally - ios

What I need,
What I get, on adding backButtonImage,
I want to shift the backButtonImage horizontally? No answers on here seem to work for me.
Any suggestions will be welcomed.
EDIT
I am just setting back image and back mask in storyboard, here it is (nav_back)

Have a look at UIBarButtonItem Size Inspector in storyboard.
You should be able to shift image to the right by X points by setting image left inset to X and right inset to -X. This worked with bar button item with custom image but not sure if it will with default back button

Related

Swift rightbar button item padding issue?

I have a right bar button item but I want to remove paddinf of it.I have looked all question here I tryied some of them such as fixedspace and image inset but it does not solve my problem.When I use image inset , it did not work all device.

The image for my UIBarButtonItem keeps stretching to the center?

I am trying to add a basic Settings icon in the top right of the navigation bar. I added a UIBarButtonItem to my navigation bar. Then I set the image, but it moved the image to the center instead of staying in the right? Is there a way to fix this?
Update: I fixed this by decreasing the dimensions of the icon closer to 40x40. It was too large.

Customising UIBarButton Item Image

So I am trying to customize a bar button item for this slideoutmenu I am creating. I want it to be a particular image. However I am having trouble doing this. Whenever I try to change the image programatically by saying
menuButton.image = UIImage(named: "myImage.png")
It appears to be all stretched. Whenever I tell it to be set to an image using the attribute inspector, it will do the same thing, and I am unable to resize it in the Main Storyboard and interface builder. I imagine the fix to be simple, but I am unable to figure it out. Is there possibly a way to customize the size of the navigation controller to give it more room? Does anybody have any ideas?
I misunderstood the question originally. It sounds like what you are asking is how you resize the image, because it's all stretched out. It might take a little adjusting, but you can set the image insets on the UIBarButtonItem programmatically:
menuButton.imageInsets = UIEdgeInsetsMake(5, 5, 5, 5)
This is just telling the button to draw the image inset 5pts from the top, 5pts from the left, 5pts from the bottom, and 5pts from the right. You can tweak those values until it looks how you wish.

can't set image for Bar Button Item

I'm using Objective-C. In Xcode, I set a image(.png) to a navigation bar button item. But no matter how I change the resolution of the image, it always going to be a blue pic, big or small.
It looks like this(the right top corner):
Does the picture cause the problem? How to solve it? Thanks in advance!
It is because of Barbutton's size is fixed.
So , my advice is add UIView as Barbutton item and then add UIButton and set image According to your required size.
Check output in below image.
Your Hierarchy will be something like this ,

Changing only the position of the default backBarButtonItem

So I have a custom nav bar in my iPad app which is a bit larger than the default 44 pixel bar (52 pixels tall). I want all the items in the nav bar to be center aligned which I have been able to do just fine with the exception of one item, the back button. I don't want to use a custom back button and instead just use the default one and just nudge its position down a bit so that its aligned with the center of my navbar. I haven't been able to find a clear answer to this and am not sure if its even possible. Anybody done something like this?
http://cl.ly/image/0g3f2M260B3C
UPDATE :
This can be done and I found the answer here : UIBarButtonItem Offset?
Ok well,but we can't change the custom back button position so try to implement that one also by custom.
By default back button position was center so we can't change that position.

Resources