I have added a custom button to the navigation bar\'s custom right bar button item as shown in the image.
I\'m want to be able to remove the space after the button
You have to create a new view, add button and everything else you want and add it to the titleView as shown.
- (void)viewDidLoad {
self.navigationItem.titleView = [self titleView];
}
- (UIView *)titleView {
CGFloat navBarHeight = self.navigationController.navigationBar.frame.size.height;
CGFloat width = 0.95 * self.view.frame.size.width;
UIView *containerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, navBarHeight)];
..
// please add what you need here
....
}