久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

animation動(dòng)畫效果

 盧瑟的城堡 2012-08-13

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) 

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,,所有內(nèi)容均由用戶發(fā)布,,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式,、誘導(dǎo)購買等信息,,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,,請點(diǎn)擊一鍵舉報(bào),。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請遵守用戶 評(píng)論公約

    類似文章 更多