免费观看又色又爽又黄的小说免费_美女福利视频国产片_亚洲欧美精品_美国一级大黄大色毛片

iOS中怎么利用CATransition實現翻頁旋轉效果-創新互聯

這篇文章將為大家詳細講解有關iOS中怎么利用CATransition實現翻頁旋轉效果,文章內容質量較高,因此小編分享給大家做個參考,希望大家閱讀完這篇文章后對相關知識有一定的了解。

創新互聯公司是一家集網站建設,鐵嶺縣企業網站建設,鐵嶺縣品牌網站建設,網站定制,鐵嶺縣網站建設報價,網絡營銷,網絡優化,鐵嶺縣網站推廣為一體的創新建站企業,幫助傳統企業提升企業形象加強企業競爭力。可充分滿足這一群體相比中小企業更為豐富、高端、多元的互聯網需求。同時我們時刻保持專業、時尚、前沿,時刻以成就客戶成長自我,堅持不斷學習、思考、沉淀、凈化自己,讓我們為更多的企業打造出實用型網站。

#import <UIKit/UIKit.h>@interface ViewController : UIViewController@end#import "ViewController.h"//獲得屏幕的寬高#define mainW [UIScreen mainScreen].bounds.size.width#define mainH [UIScreen mainScreen].bounds.size.height@interface ViewController ()@property (nonatomic, strong) NSArray *typeArray;@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor greenColor]; //創建控件 [self creatControl]; _typeArray = @[kCATransitionFade, kCATransitionPush, kCATransitionMoveIn, kCATransitionReveal, @"cube", @"suckEffect", @"oglFlip", @"rippleEffect", @"pageCurl", @"pageUnCurl", @"cameraIrisHollowOpen", @"cameraIrisHollowClose"];}- (void)creatControl{ NSArray *titleArray = @[@"淡化效果", @"推進效果", @"滑入效果", @"滑出效果", @"立方體效果", @"吮吸效果", @"翻轉效果", @"波紋效果", @"翻頁效果", @"反翻頁效果", @"開鏡頭效果", @"關鏡頭效果"]; for (int i = 0; i < titleArray.count; i++) {  CGFloat X = i % 2 == 0 ? mainW * 0.1 : mainW * 0.6;  CGFloat Y = 64 + i / 2 * mainW * 0.15;  UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(X, Y, mainW * 0.3, mainW * 0.1)];  btn.tag = i;  [btn setBackgroundColor:[UIColor colorWithRed:0.6f green:0.7f blue:0.6f alpha:0.7f]];  [btn setTitle:titleArray[i] forState:UIControlStateNormal];  [btn addTarget:self action:@selector(btnOnClick:) forControlEvents:UIControlEventTouchUpInside];  [self.view addSubview:btn]; }}- (void)btnOnClick:(UIButton *)btn{ static int i = 0; i = i == 0 ? 1 : 0; self.view.backgroundColor = i == 0 ? [UIColor greenColor] : [UIColor yellowColor]; //創建CATransition對象 CATransition *animation = [CATransition animation]; //設置時間 animation.duration = 1.0f; //設置類型 animation.type = _typeArray[btn.tag]; //設置方向 animation.subtype = kCATransitionFromRight; //設置運動速度變化 animation.timingFunction = UIViewAnimationOptionCurveEaseInOut; [self.view.layer addAnimation:animation forKey:@"animation"];}@end

CATransition.type動畫類型:

kCATransitionFade   //淡化效果kCATransitionPush   //推進效果kCATransitionMoveIn  //滑入效果kCATransitionReveal  //滑出效果@"cube"        //立方體效果@"suckEffect"      //吮吸效果@"oglFlip"        //翻轉效果@"rippleEffect"      //波紋效果@"pageCurl"       //翻頁效果@"pageUnCurl"      //反翻頁效果@"cameraIrisHollowOpen"  //開鏡頭效果@"cameraIrisHollowClose"  //關鏡頭效果

關于iOS中怎么利用CATransition實現翻頁旋轉效果就分享到這里了,希望以上內容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。

分享文章:iOS中怎么利用CATransition實現翻頁旋轉效果-創新互聯
當前網址:http://m.newbst.com/article46/cepseg.html

成都網站建設公司_創新互聯,為您提供營銷型網站建設做網站外貿建站標簽優化云服務器App設計

廣告

聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯

h5響應式網站建設