I am using the new API for UINavigationItem setRightBarButtonItems like this:
UIBarButtonItem *buttonSettings = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"settings.png"]
style:UIBarButtonItemStylePlain
target:self
action:@selector(showSettings:)];
UIBarButtonItem *buttonLogout = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemPageCurl target:self action:@selector(showSettings:)];
[[self navigationItem] setRightBarButtonItems:[NSArray arrayWithObjects:buttonLogout, buttonSettings, nil]];
But, only 1 button (settings) is appearing and logout button is not appearing at all. What am I doing wrong? Thanks
You are not allowed to do it:
UIBarButtonSystemItemPageCurl The system page curl button. This bar button image can be used only for bar button items placed on toolbars. Available in iOS 4.0 and later. Declared in UIBarButtonItem.h.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With