你好,歡迎來到IOS教程網

 Ios教程網 >> IOS編程開發 >> IOS開發綜合 >> iphone中彈出動畫的實現

iphone中彈出動畫的實現

編輯:IOS開發綜合
問題描述: 使用了下面的代碼: [plain]   FirstView * fir=[[FirstView alloc]init];   [self.navigationController pushViewController:fir animated:NO];     能否實現一個彈出動畫? 謝謝 解決方案: [plain]   -(void)ButtonAction:(id)sender{     [self SwipeRight:self.navigationController.view];  // <--calling method     //[self.navigationController pushViewController:viewcontrollerobject animated:NO];     // or pop //    }          -(void)SwipeRight:(UIView *)view{              CATransition* transition = [CATransition animation];           [transition setDuration:0.3];           transition.type = kCATransitionPush;           transition.subtype = kCATransitionFromRight;           [transition setFillMode:kCAFillModeBoth];           [transition setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];           [view.layer addAnimation:transition forKey:kCATransition];        }          -(void)SwipeLeft:(UIView *)view{           CATransition* transition = [CATransition animation];           [transition setDuration:0.3];           transition.type = kCATransitionPush;           transition.subtype = kCATransitionFromLeft;           [transition setFillMode:kCAFillModeBoth];           [transition setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];           [view.layer addAnimation:transition forKey:kCATransition];        }      
  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved