亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在基于導航的應用程序中更改Push和Pop動畫

如何在基于導航的應用程序中更改Push和Pop動畫

MYYA 2019-07-11 13:09:15
如何在基于導航的應用程序中更改Push和Pop動畫我有一個基于導航的應用程序,我想改變動畫的推送和流行動畫。我該怎么做?這個問題有很多答案,現在已經有很長一段時間了,我重新選擇了我認為最相關的答案。如果有人不這么認為,請在評論中告訴我。
查看完整描述

3 回答

?
守候你守候我

TA貢獻1802條經驗 獲得超10個贊

我做了以下工作,效果很好.簡單易懂。

CATransition* transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade; 
//kCATransitionMoveIn;
 //, kCATransitionPush, kCATransitionReveal, kCATransitionFade
 //transition.subtype = kCATransitionFromTop; 
 //kCATransitionFromLeft, kCATransitionFromRight, kCATransitionFromTop, kCATransitionFromBottom[self.navigationController.view.layer a
 ddAnimation:transition forKey:nil];[[self navigationController] popViewControllerAnimated:NO];

對推也是一樣的.。


SWIFT 3.0版本:

let transition = CATransition()transition.duration = 0.5transition.timingFunction = CAMediaTimingFunction(name: 
kCAMediaTimingFunctionEaseInEaseOut)transition.type = kCATransitionFadeself.navigationController?.view.layer.add(transition, for
Key: nil)_ = self.navigationController?.popToRootViewController(animated: false)


查看完整回答
反對 回復 2019-07-11
?
冉冉說

TA貢獻1877條經驗 獲得超1個贊

我一直都是這樣完成這個任務的。

用于推送:

MainView *nextView=[[MainView alloc] init];[UIView  beginAnimations:nil context:NULL];[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.75];[self.navigationController pushViewController:nextView animated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];[UIView commitAnimations];
[nextView release];

關于POP:

[UIView  beginAnimations:nil context:NULL];[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.75];[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:
self.navigationController.view cache:NO];[UIView commitAnimations];[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDelay:0.375];[self.navigationController popViewControllerAnimated:NO];[UIView commitAnimations];


我仍然從這得到了很多反饋,所以我將繼續更新它,以使用動畫塊,這是蘋果推薦的方式來做動畫無論如何。

用于推送:

MainView *nextView = [[MainView alloc] init];[UIView animateWithDuration:0.75
                         animations:^{
                             [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
                             [self.navigationController pushViewController:nextView animated:NO];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];
                         }];

關于POP:

[UIView animateWithDuration:0.75
                         animations:^{
                             [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
               [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO];
                         }];[self.navigationController popViewControllerAnimated:NO];


查看完整回答
反對 回復 2019-07-11
  • 3 回答
  • 0 關注
  • 703 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號