Now I have four UITableViewControllers
.
I need the following effect:
All views (A, B1, B2 and C) should have NavigationBar.
Now I can navigate between A, B1, B2, C. I can also flip to B2 using the following code:
//self is B1
- (IBAction)b2ButtonPressed
{
B2ViewController* B2 = [[B2ViewController alloc] init];
B2.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:B2 animated:YES];
}
But on B2 the NavigationBar is missing.
I have an app on my iPod touch has such feature. How can I make it myself?
If you show the view controllers by modal presenting, not by navigation controller's push or pop, you should wrap a navigation controller for the view controller in order to show the navigation bar:
- (IBAction)b2ButtonPressed
{
B2ViewController* B2 = [[B2ViewController alloc] init];
UINavigationController *B2Nav = [[UINavigationController alloc] initWithRootViewController:B2];
B2Nav.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:B2Nav animated:YES];
[B2 release];
[B2Nav release];
}
And don't forget to setup left or right bar button item for navigation bar in your B2ViewController.
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