ios - How to add a < Back button to a navigation bar? -
i have simple app push views navigation. however, on 1 of screens push tab controller 2 tabs. when navigation goes away when reach tab controller screen. on navigation of tab screens know how < back
button.
basically, want know how manually create < back
button on top left
try this:
uibarbuttonitem *backbarbutton = [[uibarbuttonitem alloc] initwithimage:[uiimage imagenamed:@"icon_back.png"] style:uibarbuttonitemstyleplain target:self action:@selector(goback:)]; self.navigationitem.leftbarbuttonitem = backbarbutton;
then write goback
method:
- (void)goback:(id)sender { [self.navigationcontroller popviewcontrolleranimated:yes]; }
note: there other initializer uibarbuttonitem. choose 1 need.
hope helps.. :)
Comments
Post a Comment