3 回答

TA貢獻(xiàn)1789條經(jīng)驗(yàn) 獲得超10個(gè)贊
您可以做的是推送下一個(gè)視圖控制器,但不對(duì)其進(jìn)行動(dòng)畫處理,如下所示:
[self.navigationController pushViewController:nextController animated:NO];
...然后,在推入的視圖控制器中,您可以使用CoreAnimation對(duì)視圖進(jìn)行自定義動(dòng)畫。這可能是最好的viewDidAppear:(BOOL)animated方法。
查看有關(guān)如何實(shí)際制作動(dòng)畫的《核心動(dòng)畫指南》。特別要看一下隱式動(dòng)畫。

TA貢獻(xiàn)1796條經(jīng)驗(yàn) 獲得超4個(gè)贊
我使用以下功能(添加到中UINavigationController)自定義推送動(dòng)畫:
- (void) pushController: (UIViewController*) controller
withTransition: (UIViewAnimationTransition) transition
{
[UIView beginAnimations:nil context:NULL];
[self pushViewController:controller animated:NO];
[UIView setAnimationDuration:.5];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationTransition:transition forView:self.view cache:YES];
[UIView commitAnimations];
}
我想您可以修改此代碼以執(zhí)行所需的任何動(dòng)畫。

TA貢獻(xiàn)1796條經(jīng)驗(yàn) 獲得超7個(gè)贊
您正在尋找的代碼:
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:0.80];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:
UIViewAnimationTransitionFlipFromRight
forView:self.navigationController.view cache:NO];
[self.navigationController pushViewController:menu animated:YES];
[UIView commitAnimations];
- 3 回答
- 0 關(guān)注
- 652 瀏覽
添加回答
舉報(bào)