2

anyone can help me on fixing excessive navigation bar button padding in Xamarin iOS. I am using default UI navigation bar and adding left bar button as well as right bar button. it looks weird when I'm adding number of right bar button because of the unwanted padding between the UI bar buttons.Manually im not setting any frames for UI bar button items

leftButtons [0] = customButton;
leftButtons [1] = logoButton;
rightButtons [0] = networkButton;
rightButtons[1] = refreshButton;
viewController.updateStatusBar (false,"TITLE",rightButtons,leftButtons);

Any help to reduce this spacing is well-appreciated thanks in advance :)

1 Answer 1

1

It worked like a charm with a single line of code:

navigationBarButtonItem.ImageInsets = new UIEdgeInsets(0,15,0,-15);

Please note, this moves only the image location not the touch area, so it's a fix only if you want to move the image spacing little bit to avoid the unwanted spacing between the navigation bar items. If you are using a UIBarButtonItem without an image with it, It may not be usefull for you

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.