国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > iOS > 正文

iOS 動畫(3)

2019-11-07 23:46:35
字體:
來源:轉載
供稿:網友

CATransition動畫設置兩個UIView

    UIView *magentaView =[[UIView alloc]initWithFrame:self.view.bounds];    magentaView.backgroundColor =[UIColor magentaColor];    [self.view addSubview:magentaView];    UIView * gtayView =[[UIView alloc]initWithFrame:self.view.bounds];    gtayView.backgroundColor =[UIColor lightGrayColor];    [self.view addSubview:gtayView];

//提交-(void)add{    //    開始動畫    [UIView beginAnimations:@"animation" context:nil];    [UIView setAnimationDuration:1.0];    [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:YES];    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];    [self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];    //     提交動畫    [UIView commitAnimations];}//翻頁-(void)curl{    //    開始動畫    [UIView beginAnimations:@"animation" context:nil];    [UIView setAnimationDuration:1.0f];    [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];    [self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];    //     提交動畫    [UIView commitAnimations];}//移入-(void)move{    CATransition *strasiton =[CATransition animation];    strasiton.duration = 2.0f;     //    使用kCATransitionMoveIn動畫    strasiton.type = kCATransitionMoveIn;    //      指定動畫方向,從左向右    strasiton.subtype = kCATransitionFromLeft;    [self.view.layer addAnimation:strasiton forKey:@"animation"];    [self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];}//揭開-(void)reveal{        CATransition *strasiton =[CATransition animation];    strasiton.duration = 2.0f;    //    使用kCATransitionReveal動畫    strasiton.type = kCATransitionReveal;     strasiton.subtype = kCATransitionFromTop;    [self.view.layer addAnimation:strasiton forKey:@"animation"];    [self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];}//立方體-(void)cube{    CATransition *trasiton =[CATransition animation];    trasiton.duration = 2.0f;    trasiton.type = @"cube";    trasiton.subtype = kCATransitionFromLeft;    [self.view.layer addAnimation:trasiton forKey:@"animation"];    [self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];}//吸入-(void)suck{    CATransition *trasiton =[CATransition animation];    trasiton.duration = 2.0f;    trasiton.type = @"suckEffect";    trasiton.subtype = kCATransitionFromLeft;    [self.view.layer addAnimation:trasiton forKey:@"animation"];    [self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];}//翻轉-(void)oglFlip{    CATransition *trasiton =[CATransition animation];    trasiton.duration = 2.0f;    trasiton.type = @"oglFlip";    trasiton.subtype = kCATransitionFromLeft;    [self.view.layer addAnimation:trasiton forKey:@"animation"];    [self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];    }//水波-(void)ripple{    CATransition *trasiton =[CATransition animation];    trasiton.duration = 2.0f;    trasiton.type = @"rippleEffect";    trasiton.subtype = kCATransitionFromLeft;    [self.view.layer addAnimation:trasiton forKey:@"animation"];    [self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];}


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 涿鹿县| 漳浦县| 罗定市| 晴隆县| 临海市| 灵川县| 霍邱县| 甘肃省| 鄱阳县| 仙桃市| 洱源县| 娱乐| 临城县| 启东市| 宜兰市| 闻喜县| 襄垣县| 塔城市| 会泽县| 登封市| 佛学| 麦盖提县| 平武县| 乌拉特前旗| 竹溪县| 万全县| 抚松县| 雅江县| 大港区| 昔阳县| 潼南县| 富平县| 乌鲁木齐县| 东至县| 固阳县| 读书| 永修县| 保亭| 沭阳县| 庆城县| 浦城县|