In UITableView
I configure self.navigationItem.leftBarButtonItem
with a button. Now I want to reload this button to update text on this button, but it's on Navigation bar
. I can update UITableView
by
[self.tableView reloadData]
but How to update Navigation bar?
Update: I'm NOT init the title of button, but reload it. So any init code (such as self.navigationItem.leftBarButtonItem.title = @"balabala"
) doesn't work, because it does NOT take effect immediately.
Click the Collapse Pane icon in the space between the Navigation Bar and the Main Window. The Navigation Bar is collapsed, and the Main Window is expanded horizontally across the entire screen. 2. To restore the Navigation Bar to its original width, click the Restore Pane icon on the left side of the window.
The Navigation Toolbar is the toolbar that shows in the screenshot below the Tab bar the the location (address) bar on it. Firefox uses a combined Stop/Reload/Go button that is positioned at the right end of the location bar. You get a Stop button during page loading that changes to a Reload button when the page has finished loading.
A navigation bar is a navigation header that is placed at the top of the page: With Bootstrap, a navigation bar can extend or collapse, depending on the screen size. A standard navigation bar is created with <nav class="navbar navbar-default">. The following example shows how to add a navigation bar to the top of the page: ...
There is now one large urlbar container that contains the location bar and the Back and Forward buttons and the combined Stop/Reload/Go button that is located at the right end of the location bar. This urlbar container is locked to its position on the Navigation Toolbar and can't be moved.
The navigation bar can also be fixed at the top or at the bottom of the page. A fixed navigation bar stays visible in a fixed position (top or bottom) independent of the page scroll. The .navbar-fixed-top class makes the navigation bar fixed at the top:
Just change the text on the leftBarButtonItem?
self.navigationItem.leftBarButtonItem.title = @"Back"; // or whatever text you want
Try this
UIBarButtonItem *btnBack = [[UIBarButtonItem alloc]
initWithTitle:@"Title"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(OnClick:)];
self.navigationItem.leftBarButtonItem = btnBack;
Hope this helps you..
EDIT :-
UIBarButtonItem *btnBack = [[UIBarButtonItem alloc] initWithTitle: @"Title" style: UIBarButtonItemStyleBordered target:self action:@selector(OnClick:)];
[[self navigationItem] setBackBarButtonItem: btnBack];
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