自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

iPhone開發(fā)中動(dòng)畫效果實(shí)現(xiàn)分類附代碼

移動(dòng)開發(fā) iOS
本文介紹的是iPhone開發(fā)中動(dòng)畫效果實(shí)現(xiàn)分類的代碼,主要是實(shí)現(xiàn)動(dòng)畫中分類的效果,來看內(nèi)容。

iPhone開發(fā)中動(dòng)畫效果實(shí)現(xiàn)分類代碼是本文要介紹的內(nèi)容,但是內(nèi)容不是很多,主要是以代碼的形式來實(shí)現(xiàn)動(dòng)畫的分類,來看詳細(xì)代碼,希望對(duì)你幫助!

  1. {  
  2.     [UIView beginAnimations:nil context:nil];  
  3.     [UIView setAnimationRepeatCount:1];  
  4.     [UIView setAnimationDuration:1];  
  5.     [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];   
  6.     [UIView setAnimationDelegate:self];  
  7.     [UIView setAnimationDidStopSelector:@selector(resetView)];  
  8.       
  9.     CGAffineTransform oneTransform = CGAffineTransformRotate(self.animatView.transform, degreesToRadian(180));  
  10.     CGAffineTransform twoTransform = CGAffineTransformTranslate(self.animatView.transform,0,-100);  
  11.     CGAffineTransform newTransform = CGAffineTransformConcat(oneTransform, twoTransform);  
  12.     [self.animatView setTransform:newTransform];  
  13.     [UIView commitAnimations];  
  14. }  
  15. - (void) second_animations  
  16. {  
  17.     CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"opacity"];  
  18.     [animation setDuration:1];  
  19.     [animation setRepeatCount:0];  
  20.     [animation setAutoreverses:YES];//自動(dòng)反向動(dòng)畫  
  21.     [animation setFromValue:[NSNumber numberWithFloat:1.0]];  
  22.     [animation setToValue:[NSNumber numberWithFloat:0]];  
  23.     [animation setDelegate:self];  
  24.     [self.animatView.layer addAnimation:animation forKey:@"firstView-Opacity"];  
  25. }  
  26. - (void) third_animations  
  27. {  
  28.     [UIView beginAnimations:nil context:nil];  
  29.     [UIView setAnimationRepeatCount:1];  
  30.     [UIView setAnimationDuration:1];  
  31.     [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];   
  32.     [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.containView cache:YES];  
  33.     [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:)];  
  34.     [UIView commitAnimations];  
  35. }  
  36. - (void) fourth_animations  
  37. {  
  38.     CATransition *transition = [CATransition animation];  
  39.     transition.duration = 1.0f;           
  40.     transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];   
  41.     transition.type = @"pageCurl";  //@"cube" @"moveIn" @"reveal" @"fade"(default) @"pageCurl" 
  42. @"pageUnCurl" @"suckEffect" @"rippleEffect" @"oglFlip"  
  43.     transition.subtype = kCATransitionFromRight;  
  44.     transition.removedOnCompletion = YES;  
  45.     transition.fillMode = kCAFillModeBackwards;  
  46.     transition.delegate = self;  
  47.     [self.animatView.layer addAnimation:transition forKey:nil];    
  48. }  
  49. -(void) resetView  
  50. {  
  51.     [self.animatView setTransform:CGAffineTransformRotate(self.animatView.transform, degreesToRadian(180))];  
  52.     self.animatView.frame = CGRectMake(0, 0, 280, 200);  
  53. }  
  54. #pragma mark Delegate Methods  
  55. - (void)animationDidStop:(CAAnimation *) theAnimation finished:(BOOL) flag {  
  56.     self.animatView.frame = CGRectMake(0, 0, 280, 200);  
  57. }  
  58.  
  59. #define degreesToRadian(x) (M_PI * (x) / 180.0) 

小結(jié):iPhone開發(fā)中動(dòng)畫效果實(shí)現(xiàn)分類代碼的內(nèi)容介紹完了,希望通過本文的學(xué)習(xí)對(duì)你有所幫助!

責(zé)任編輯:zhaolei 來源: 互聯(lián)網(wǎng)
相關(guān)推薦

2011-08-12 14:04:53

iPhone動(dòng)畫

2011-07-08 10:15:15

IPhone 動(dòng)畫

2011-08-08 10:42:46

iPhone UITableVie 分頁

2011-08-16 18:13:42

IPhone開發(fā)UIView動(dòng)畫

2011-08-22 14:21:24

iPhone開發(fā)UIView Anim

2011-07-29 13:55:10

IPhone 動(dòng)畫

2013-07-05 10:26:40

Android

2010-09-10 09:57:27

DIV樣式

2011-07-08 15:08:16

iPhone 圖片

2022-07-28 14:33:32

webviewweb頁面

2010-08-03 11:29:09

Flex全屏

2017-01-22 17:25:55

Android放大鏡效果源碼分析

2011-08-15 13:50:06

IPhone開發(fā)UIView動(dòng)畫

2011-07-22 18:20:04

IOS View 動(dòng)畫

2011-08-15 11:23:41

iPhone開發(fā)循環(huán)滾動(dòng)UIScrollVie

2013-06-25 11:21:35

Android開發(fā)幻燈片效果Gallery

2009-12-25 14:25:39

WPF圖標(biāo)

2010-09-10 14:33:32

SQL循環(huán)語句

2011-07-27 11:19:33

iPhone UITableVie

2011-08-16 14:54:12

iphone開發(fā)APP
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)