UIBarButtonItem UIBarButtonItemStyleBordered
UIBarButtonItemStyle
Specifies the style of a item.
typedef enum {
UIBarButtonItemStylePlain,
UIBarButtonItemStyleBordered,
UIBarButtonItemStyleDone,
} UIBarButtonItemStyle;
Constants
UIBarButtonItemStylePlain
Glows when tapped. The default item style.
UIBarButtonItemStyleBordered
A simple button style with a border.
UIBarButtonItemStyleDone
The style for a done button—for example, a button that completes some task and returns to the previous view.
UIBarButtonItem UIBarButtonItemStyleBordered example.
// Set to done
editButton.style = UIBarButtonItemStyleDone;
editButton.title = @"Done";
// Set back to edit
editButton.style = UIBarButtonItemStyleBordered;
editButton.title = @"Edit";
editButton.style = UIBarButtonItemStyleDone;
editButton.title = @"Done";
// Set back to edit
editButton.style = UIBarButtonItemStyleBordered;
editButton.title = @"Edit";
Example of [UIBarButtonItem UIBarButtonItemStyleBordered].
to change the button the Done button use this
[self.navigationItem.rightBarButtonItem setStyle:UIBarButtonItemStyleDone];
to change the button to Edit button use this
[self.navigationItem.rightBarButtonItem setStyle:UIBarButtonItemStyleBordered];
[self.navigationItem.rightBarButtonItem setStyle:UIBarButtonItemStyleDone];
to change the button to Edit button use this
[self.navigationItem.rightBarButtonItem setStyle:UIBarButtonItemStyleBordered];
UIBarButtonItem UIBarButtonItemStyleBordered example.
NSString *title = app.settings.editing
? NSLocalizedString(@"Done", @"")
: NSLocalizedString(@"Edit", @"");
UIBarButtonItemStyle style = app.settings.editing
? UIBarButtonItemStyleDone
: UIBarButtonItemStyleBordered;
UIBarButtonItem *editButton
= [[UIBarButtonItem alloc] initWithTitle:title
style:style
target:self.editButton.target
action:self.editButton.action];
self.navigationItem.rightBarButtonItem = editButton;
? NSLocalizedString(@"Done", @"")
: NSLocalizedString(@"Edit", @"");
UIBarButtonItemStyle style = app.settings.editing
? UIBarButtonItemStyleDone
: UIBarButtonItemStyleBordered;
UIBarButtonItem *editButton
= [[UIBarButtonItem alloc] initWithTitle:title
style:style
target:self.editButton.target
action:self.editButton.action];
self.navigationItem.rightBarButtonItem = editButton;