Zha*_*ang 5 iphone uiviewcontroller uiviewanimation
现在我有四个UITableViewControllers.
我需要以下效果:
所有视图(A,B1,B2和C)都应该有NavigationBar.
现在我可以在A,B1,B2,C之间导航.我也可以使用以下代码翻到B2:
//self is B1
- (IBAction)b2ButtonPressed
{
B2ViewController* B2 = [[B2ViewController alloc] init];
B2.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:B2 animated:YES];
}
Run Code Online (Sandbox Code Playgroud)
但在B2上,NavigationBar缺失了.
我的iPod touch上有一个应用程序有这样的功能.我怎么能自己做?
如果通过模态显示而不是通过导航控制器的push或pop显示视图控制器,则应该为视图控制器包装导航控制器以显示导航栏:
- (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];
}
Run Code Online (Sandbox Code Playgroud)
并且不要忘记在B2ViewController中为导航栏设置左侧或右侧栏按钮项.
| 归档时间: |
|
| 查看次数: |
5042 次 |
| 最近记录: |