The rightmost Bar Button Item in UIToolBar in objective-C
Questions tagged [rightbarbuttonitem]
112 questions
53
votes
15 answers
How to adjust space between two UIBarButtonItem in rightBarButtonItems
I am using the following codes to add two button to self.navigationItem.rightBarButtonItems, and I think in iOS7, the space between two buttons are too wide, is there a way to decrease the space between these two buttons?
UIBarButtonItem…

Bob
- 2,263
- 5
- 21
- 30
50
votes
18 answers
How do I hide/show the right button in the Navigation Bar
I need to hide the right button in the Navigation Bar, then unhide it after the user selects some options.
Unfortunately, the following doesn't work:
NO GOOD: self.navigationItem.rightBarButtonItem.hidden = YES; // FOO CODE
Is there a way?

Lauren Quantrell
- 2,647
- 6
- 36
- 49
18
votes
3 answers
Hide the rightBarButtonItem of a navigation controller
Does anyone know how to hide a rightBarButtonItem of a UINavigationController? In my application, I have an edit button as a rightBarButtonItem of a UINavigationController. I want to hide this ? UIBarButton` when some operations are done.

user347161
- 327
- 1
- 4
- 14
16
votes
1 answer
rightBarButtonItem does not appear in Navigation Bar iOS
I'm having problems displaying the rightBarButtonItem of the Navigation Bar - I'm attempting to create it programmatically in the Application Delegate, where my UINavigationController is set up.
Code is as follows:
- (BOOL)application:(UIApplication…

Russell
- 199
- 1
- 1
- 7
10
votes
3 answers
Making uibarbuttonitems fade
I have a navigation bar that is set up and controlled completely with code. So it does not show up in IB. I have a button appear by "self.navigationitem.rightbarbutton = myButton;"
An I make it go away by setting it equal to NIL. What I am wondering…

user804306
- 777
- 1
- 8
- 15
10
votes
4 answers
setting the size of navigationbar icon ios
I want to know is there any default size for Navigationbar icons.where designer need to design it.Should they design it for retina and non-retina display.At present I'm using images downloaded from internet which are not looking great.

user2823044
- 315
- 2
- 5
- 14
9
votes
2 answers
rightBarButtonItem info button, no space to the right
I have a UIViewController set up to display an info-button on the right in its UINavigationItem like this:
UIButton *infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight];
[infoButton addTarget:self action:@selector(toggleAboutView)…

Emil
- 7,220
- 17
- 76
- 135
9
votes
10 answers
How to hide share button in QLPreviewController using swift?
I'm using the below code to use QLPreviewcontroller to show some documents in my app,
let ql = QLPreviewController()
ql.dataSource = self
//ql.navigationItem.rightBarButtonItems = nil
ql.navigationItem.rightBarButtonItem =…

Nazik
- 8,696
- 27
- 77
- 123
8
votes
1 answer
when editButtonItem clicked, no red delete icon shows
I am writing an IPhone IM chat window now.
You know if the nagviationItem.rightBarItem in an UITableviewController is set to editButtonItem, you click the edit button then a red delete icon is shown to every single row, like shown here.
The problem…

Michael Z
- 4,534
- 4
- 21
- 27
7
votes
1 answer
Showing dropdown menu (popover) below BarButtonItem on click
When I click "+" I want to show menu (popover) under the right BarButtonItem where will be two options. Pressing one of those options will lead to other view controllers.
I'm using Xcode 10 and Swift 4.2.
Like this:
This is my code for now and…

Hrvoje
- 696
- 7
- 22
7
votes
3 answers
Right bar button not appearing in iphone 6 and 6+
I am trying to add a Right bar button in my tabbar's navigationbar, and its working fine in iphone 5 and 5s device and all simulators. But its not showing up in iphone 6 and 6+ device.However its working fine on simulator of iphone 6 and 6+.
Here is…

Saad Chaudhry
- 1,392
- 23
- 37
7
votes
2 answers
Reduce blank space between bar button items in UINavigationBar
I notice the blank space between bar button items is quite large. I want to reduce the space to have more room for my title. I tried to create fixed space then added it among the buttons but it didn't work. Does anybody know how to do…

LongNV
- 892
- 9
- 21
5
votes
3 answers
Right navbar button moves when alertview is dismissed
I'm adapting an iOS 6 app to iOS 7 and I'm experiencing an strange "error". In a screen there's a rightBarButtonItem with a simple image that is showed in his place. But, if the app shows an alertview, the image moves down (50 px or so) when I tap…

raul
- 309
- 1
- 3
- 15
5
votes
3 answers
iPhone flip right button (like iTunes)
I'm trying to flip between two views. That's easy, the code is below, but I also want to simultaneously flip the button used to perform the flip.
You can see this behavior in the iPod application when you're playing a track; tapping the flip button…

Steven Fisher
- 44,462
- 20
- 138
- 192
4
votes
1 answer
iOS 11's Navigation Bar's RightBarButton greyed out when returning from a pushed ViewController
I set a LeftBarButton "Cancel" and a RightBarButton "OK" this way
_barButtonOK = [[UIBarButtonItem alloc] initWithTitle:@"OK" style:UIBarButtonItemStyleDone target:self action:@selector(barButtonOKAction)];
[_barButtonOK…

Zhengqian Kuang
- 1,079
- 1
- 9
- 12