Per*_*eus 2 iphone cocoa-touch uiviewcontroller uinavigationcontroller ios
我有四个ViewControllers,其中ViewControllers使用UINavigationController.我可以逐个切换到每个ViewController.
问题是,因为我使用的是NavigationController,所有的ViewControllers都是从Left或Right加载的.但我想从底部加载ViewController.我知道我可以使用presentModalViewController从底部呈现ViewController.但它不等同于导航控制器,因为从第4个ViewController,如果我按下一个按钮,我需要来到第一个ViewController.
如何从NavigationController底部呈现ViewController?
iPh*_*per 10
试试这个:
CATransition *animation = [CATransition animation];
[animation setDuration:2];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromTop];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
SecondView *sObj=[[SecondView alloc] initWithNibName:@"SecondView" bundle:nil];
[self.navigationController pushViewController:sObj animated:YES];
[[sObj.view layer] addAnimation:animation forKey:@"SwitchToView1"];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6585 次 |
| 最近记录: |