2018-06-13

在iOS實際開發(fā)中常用的動畫無非是以下四種:UIView動畫,核心動畫,幀動畫,自定義轉(zhuǎn)場動畫。下面我們逐個介紹。

1.UIView動畫

能實現(xiàn)UIView動畫的屬性

UIView動畫是iOS開發(fā)中最廉價也是最常用的動畫。

UIView動畫能夠設(shè)置的動畫屬性有:

frame

bounds

center

transform

alpha

backgroundColor

contentStretch

UIView動畫實現(xiàn)方式

UIView動畫實現(xiàn)方式有普通方式和Block方式,不過平常我們一般會直接使用Block的方式。簡單,粗暴,管用!

先說說普通方式實現(xiàn)動畫。

開始動畫語句:

// 第一個參數(shù): 動畫標(biāo)識// 第二個參數(shù): 附加參數(shù),在設(shè)置代理情況下,此參數(shù)將發(fā)送到setAnimationWillStartSelector和setAnimationDidStopSelector所指定的方法,大部分情況,設(shè)置為nil.[UIViewbeginAnimations:(nullableNSString*) context:(nullablevoid*)];

結(jié)束動畫語句:

[UIViewcommitAnimations];

動畫參數(shù)的屬性設(shè)置:

//動畫持續(xù)時間[UIViewsetAnimationDuration:(NSTimeInterval)];//動畫的代理對象 [UIViewsetAnimationDelegate:(nullableid)];//設(shè)置動畫將開始時代理對象執(zhí)行的SEL[UIViewsetAnimationWillStartSelector:(nullableSEL)];//設(shè)置動畫延遲執(zhí)行的時間[UIViewsetAnimationDelay:(NSTimeInterval)];//設(shè)置動畫的重復(fù)次數(shù)[UIViewsetAnimationRepeatCount:(float)];//設(shè)置動畫的曲線/*

UIViewAnimationCurve的枚舉值:

UIViewAnimationCurveEaseInOut,? ? ? ? // 慢進(jìn)慢出(默認(rèn)值)

UIViewAnimationCurveEaseIn,? ? ? ? ? ? // 慢進(jìn)

UIViewAnimationCurveEaseOut,? ? ? ? ? // 慢出

UIViewAnimationCurveLinear? ? ? ? ? ? // 勻速

*/[UIViewsetAnimationCurve:(UIViewAnimationCurve)];//設(shè)置是否從當(dāng)前狀態(tài)開始播放動畫/*假設(shè)上一個動畫正在播放,且尚未播放完畢,我們將要進(jìn)行一個新的動畫:

當(dāng)為YES時:動畫將從上一個動畫所在的狀態(tài)開始播放

當(dāng)為NO時:動畫將從上一個動畫所指定的最終狀態(tài)開始播放(此時上一個動畫馬上結(jié)束)*/[UIViewsetAnimationBeginsFromCurrentState:YES];//設(shè)置動畫是否繼續(xù)執(zhí)行相反的動畫[UIViewsetAnimationRepeatAutoreverses:(BOOL)];//是否禁用動畫效果(對象屬性依然會被改變,只是沒有動畫效果)[UIViewsetAnimationsEnabled:(BOOL)];//設(shè)置視圖的過渡效果/* 第一個參數(shù):UIViewAnimationTransition的枚舉值如下

? ? UIViewAnimationTransitionNone,? ? ? ? ? ? ? //不使用動畫

? ? UIViewAnimationTransitionFlipFromLeft,? ? ? //從左向右旋轉(zhuǎn)翻頁

? ? UIViewAnimationTransitionFlipFromRight,? ? //從右向左旋轉(zhuǎn)翻頁

? ? UIViewAnimationTransitionCurlUp,? ? ? ? ? ? //從下往上卷曲翻頁

? ? UIViewAnimationTransitionCurlDown,? ? ? ? ? //從上往下卷曲翻頁

第二個參數(shù):需要過渡效果的View

第三個參數(shù):是否使用視圖緩存,YES:視圖在開始和結(jié)束時渲染一次;NO:視圖在每一幀都渲染*/[UIViewsetAnimationTransition:(UIViewAnimationTransition) forView:(nonnullUIView*) cache:(BOOL)];

下面列出三個??:

UIView動畫例子1.gif

代碼如下:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent*)event{UITouch*tuch = touches.anyObject;CGPointpoint = [tuch locationInView:self.view];? ? ? ? [UIViewbeginAnimations:@"testAnimation"context:nil];? ? [UIViewsetAnimationDuration:3.0];? ? [UIViewsetAnimationDelegate:self];//設(shè)置動畫將開始時代理對象執(zhí)行的SEL[UIViewsetAnimationWillStartSelector:@selector(animationDoing)];//設(shè)置動畫延遲執(zhí)行的時間[UIViewsetAnimationDelay:0];? ? ? ? [UIViewsetAnimationRepeatCount:MAXFLOAT];? ? [UIViewsetAnimationCurve:UIViewAnimationCurveLinear];//設(shè)置動畫是否繼續(xù)執(zhí)行相反的動畫[UIViewsetAnimationRepeatAutoreverses:YES];self.redView.center = point;self.redView.transform =CGAffineTransformMakeScale(1.5,1.5);self.redView.transform =CGAffineTransformMakeRotation(M_PI);? ? ? ? [UIViewcommitAnimations];}

UIView動畫例子2.gif

代碼如下:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent*)event{// 轉(zhuǎn)成動畫 (flip)[UIViewbeginAnimations:@"imageViewTranslation"context:nil];? ? [UIViewsetAnimationDuration:2.0];? ? [UIViewsetAnimationDelegate:self];? ? [UIViewsetAnimationWillStartSelector:@selector(startAnimation)];? ? [UIViewsetAnimationDidStopSelector:@selector(stopAnimation)];? ? [UIViewsetAnimationRepeatCount:1.0];? ? [UIViewsetAnimationCurve:UIViewAnimationCurveEaseInOut];? ? [UIViewsetAnimationRepeatAutoreverses:YES];? ? [UIViewsetAnimationRepeatCount:MAXFLOAT];? ? [UIViewsetAnimationTransition:UIViewAnimationTransitionFlipFromLeftforView:self.imageView cache:YES];if(++count %2==0) {self.imageView.image = [UIImageimageNamed:@"yh_detial_ty"];? ? }else{self.imageView.image = [UIImageimageNamed:@"yh_detial_bz"];? ? }? ? [UIViewcommitAnimations];? ? }

AnimationTransitionCurlUp.gif

代碼如下:

[UIViewbeginAnimations:@"test"context:nil];? ? ? ? [UIViewsetAnimationDuration:1.0];? ? [UIViewsetAnimationRepeatCount:MAXFLOAT];? ? [UIViewsetAnimationTransition:UIViewAnimationTransitionCurlUpforView:self.redView cache:YES];? ? ? ? [UIViewcommitAnimations];

UIView Block 動畫

ios4.0以后增加了Block動畫塊,提供了更簡潔的方式來實現(xiàn)動畫.日常開發(fā)中一般也是使用Block形式創(chuàng)建動畫。

最簡潔的Block動畫:包含時間和動畫:

[UIViewanimateWithDuration:(NSTimeInterval)//動畫持續(xù)時間animations:^{//執(zhí)行的動畫}];

帶有動畫提交回調(diào)的Block動畫

[UIViewanimateWithDuration:(NSTimeInterval)//動畫持續(xù)時間animations:^{//執(zhí)行的動畫}? ? ? ? ? ? ? ? completion:^(BOOLfinished) {//動畫執(zhí)行提交后的操作}];

可以設(shè)置延時時間和過渡效果的Block動畫

[UIViewanimateWithDuration:(NSTimeInterval)//動畫持續(xù)時間delay:(NSTimeInterval)//動畫延遲執(zhí)行的時間options:(UIViewAnimationOptions)//動畫的過渡效果animations:^{//執(zhí)行的動畫}? ? ? ? ? ? ? ? completion:^(BOOLfinished) {//動畫執(zhí)行提交后的操作}];

UIViewAnimationOptions的枚舉值如下,可組合使用:

UIViewAnimationOptionLayoutSubviews//進(jìn)行動畫時布局子控件UIViewAnimationOptionAllowUserInteraction//進(jìn)行動畫時允許用戶交互UIViewAnimationOptionBeginFromCurrentState//從當(dāng)前狀態(tài)開始動畫UIViewAnimationOptionRepeat//無限重復(fù)執(zhí)行動畫UIViewAnimationOptionAutoreverse//執(zhí)行動畫回路UIViewAnimationOptionOverrideInheritedDuration//忽略嵌套動畫的執(zhí)行時間設(shè)置UIViewAnimationOptionOverrideInheritedCurve//忽略嵌套動畫的曲線設(shè)置UIViewAnimationOptionAllowAnimatedContent//轉(zhuǎn)場:進(jìn)行動畫時重繪視圖UIViewAnimationOptionShowHideTransitionViews//轉(zhuǎn)場:移除(添加和移除圖層的)動畫效果UIViewAnimationOptionOverrideInheritedOptions//不繼承父動畫設(shè)置UIViewAnimationOptionCurveEaseInOut//時間曲線,慢進(jìn)慢出(默認(rèn)值)UIViewAnimationOptionCurveEaseIn//時間曲線,慢進(jìn)UIViewAnimationOptionCurveEaseOut//時間曲線,慢出UIViewAnimationOptionCurveLinear//時間曲線,勻速UIViewAnimationOptionTransitionNone//轉(zhuǎn)場,不使用動畫UIViewAnimationOptionTransitionFlipFromLeft//轉(zhuǎn)場,從左向右旋轉(zhuǎn)翻頁UIViewAnimationOptionTransitionFlipFromRight//轉(zhuǎn)場,從右向左旋轉(zhuǎn)翻頁UIViewAnimationOptionTransitionCurlUp//轉(zhuǎn)場,下往上卷曲翻頁UIViewAnimationOptionTransitionCurlDown//轉(zhuǎn)場,從上往下卷曲翻頁UIViewAnimationOptionTransitionCrossDissolve//轉(zhuǎn)場,交叉消失和出現(xiàn)UIViewAnimationOptionTransitionFlipFromTop//轉(zhuǎn)場,從上向下旋轉(zhuǎn)翻頁UIViewAnimationOptionTransitionFlipFromBottom//轉(zhuǎn)場,從下向上旋轉(zhuǎn)翻頁

Spring動畫

ios7.0以后新增了Spring動畫(IOS系統(tǒng)動畫大部分采用Spring Animation, 適用所有可被添加動畫效果的屬性)

[UIViewanimateWithDuration:(NSTimeInterval)//動畫持續(xù)時間delay:(NSTimeInterval)//動畫延遲執(zhí)行的時間usingSpringWithDamping:(CGFloat)//震動效果,范圍0~1,數(shù)值越小震動效果越明顯initialSpringVelocity:(CGFloat)//初始速度,數(shù)值越大初始速度越快options:(UIViewAnimationOptions)//動畫的過渡效果animations:^{//執(zhí)行的動畫}? ? ? ? ? ? ? ? ? completion:^(BOOLfinished) {//動畫執(zhí)行提交后的操作}];

Keyframes動畫

IOS7.0后新增了關(guān)鍵幀動畫,支持屬性關(guān)鍵幀,不支持路徑關(guān)鍵幀 [UIViewanimateKeyframesWithDuration:(NSTimeInterval)//動畫持續(xù)時間delay:(NSTimeInterval)//動畫延遲執(zhí)行的時間options:(UIViewKeyframeAnimationOptions)//動畫的過渡效果animations:^{//執(zhí)行的關(guān)鍵幀動畫}? ? ? ? ? ? ? ? ? ? ? completion:^(BOOLfinished) {//動畫執(zhí)行提交后的操作}];

UIViewKeyframeAnimationOptions的枚舉值如下,可組合使用:

UIViewAnimationOptionLayoutSubviews//進(jìn)行動畫時布局子控件UIViewAnimationOptionAllowUserInteraction//進(jìn)行動畫時允許用戶交互UIViewAnimationOptionBeginFromCurrentState//從當(dāng)前狀態(tài)開始動畫UIViewAnimationOptionRepeat//無限重復(fù)執(zhí)行動畫UIViewAnimationOptionAutoreverse//執(zhí)行動畫回路UIViewAnimationOptionOverrideInheritedDuration//忽略嵌套動畫的執(zhí)行時間設(shè)置UIViewAnimationOptionOverrideInheritedOptions//不繼承父動畫設(shè)置UIViewKeyframeAnimationOptionCalculationModeLinear//運(yùn)算模式 :連續(xù)UIViewKeyframeAnimationOptionCalculationModeDiscrete//運(yùn)算模式 :離散UIViewKeyframeAnimationOptionCalculationModePaced//運(yùn)算模式 :均勻執(zhí)行UIViewKeyframeAnimationOptionCalculationModeCubic//運(yùn)算模式 :平滑UIViewKeyframeAnimationOptionCalculationModeCubicPaced//運(yùn)算模式 :平滑均勻

各種運(yùn)算模式的直觀比較如下圖:

UIViewKeyframeAnimationOptions效果對比圖.png

增加關(guān)鍵幀方法:

[UIViewaddKeyframeWithRelativeStartTime:(double)//動畫開始的時間(占總時間的比例)relativeDuration:(double)//動畫持續(xù)時間(占總時間的比例)animations:^{//執(zhí)行的動畫}];

轉(zhuǎn)場動畫:

a.從舊視圖到新視圖的動畫效果

[UIViewtransitionFromView:(nonnullUIView*) toView:(nonnullUIView*) duration:(NSTimeInterval) options:(UIViewAnimationOptions) completion:^(BOOLfinished) {//動畫執(zhí)行提交后的操作}];

在該動畫過程中,fromView 會從父視圖中移除,并將 toView 添加到父視圖中,注意轉(zhuǎn)場動畫的作用對象是父視圖(過渡效果體現(xiàn)在父視圖上)。調(diào)用該方法相當(dāng)于執(zhí)行下面兩句代碼:

[fromView.superview addSubview:toView];[fromView removeFromSuperview];

單個視圖的過渡效果

[UIViewtransitionWithView:(nonnullUIView*)? ? ? ? ? ? ? duration:(NSTimeInterval)? ? ? ? ? ? ? ? options:(UIViewAnimationOptions)? ? ? ? ? ? animations:^{//執(zhí)行的動畫}? ? ? ? ? ? completion:^(BOOLfinished) {//動畫執(zhí)行提交后的操作}];

下面依舊舉兩個??:

UIView動畫例子3.gif

代碼如下:

[UIViewanimateWithDuration:3.0animations:^{self.redView.center = point;self.redView.transform =CGAffineTransformMakeScale(1.5,1.5);self.redView.transform =CGAffineTransformMakeRotation(M_PI);? ? } completion:^(BOOLfinished) {? ? ? ? [UIViewanimateWithDuration:2.0animations:^{self.redView.frame =CGRectMake(100,100,100,100);self.redView.transform =CGAffineTransformMakeScale(1/1.5,1/1.5);self.redView.transform =CGAffineTransformMakeRotation(M_PI);? ? ? ? }];? ? }];

UIView動畫例子4.gif

代碼如下:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent*)event{self.redView.alpha =0;/*

animateWithDuration 動畫持續(xù)時間

delay 動畫延遲執(zhí)行的時間

usingSpringWithDamping 震動效果,范圍0~1,數(shù)值越小震動效果越明顯

initialSpringVelocity 初始速度,數(shù)值越大初始速度越快

options 動畫的過渡效果

*/[UIViewanimateWithDuration:3.0delay:1.0usingSpringWithDamping:0.3initialSpringVelocity:1options:UIViewAnimationOptionAllowUserInteractionanimations:^{self.redView.alpha =1.0;self.redView.frame =CGRectMake(200,350,140,140);? ? } completion:^(BOOLfinished) {? ? ? ? [self.redView removeFromSuperview];? ? }];}

2.核心動畫

說道核心動畫,那就不得不先說下CALayer。

在iOS系統(tǒng)中,你能看得見摸得著的東西基本上都是UIView,比如一個按鈕、一個文本標(biāo)簽、一個文本輸入框、一個圖標(biāo)等等,這些都是UIView。

其實UIView之所以能顯示在屏幕上,完全是因為它內(nèi)部的一個層。

在創(chuàng)建UIView對象時,UIView內(nèi)部會自動創(chuàng)建一個層(即CALayer對象),通過UIView的layer屬性可以訪問這個層。當(dāng)UIView需要顯示到屏幕上時,會調(diào)用drawRect:方法進(jìn)行繪圖,并且會將所有內(nèi)容繪制在自己的層上,繪圖完畢后,系統(tǒng)會將層拷貝到屏幕上,于是就完成了UIView的顯示。

換句話說,UIView本身不具備顯示的功能,是它內(nèi)部的層才有顯示功能。

上面已經(jīng)說過了,UIView之所以能夠顯示,完全是因為內(nèi)部的CALayer對象。因此,通過操作這個CALayer對象,可以很方便地調(diào)整UIView的一些界面屬性,比如:陰影、圓角大小、邊框?qū)挾群皖伾取?/p>

//下面是CALayer的一些屬性介紹//寬度和高度@propertyCGRectbounds;//位置(默認(rèn)指中點,具體由anchorPoint決定)@propertyCGPointposition;//錨點(x,y的范圍都是0-1),決定了position的含義@propertyCGPointanchorPoint;//背景顏色(CGColorRef類型)@propertyCGColorRefbackgroundColor;//形變屬性@propertyCATransform3Dtransform;//邊框顏色(CGColorRef類型)@propertyCGColorRefborderColor;//邊框?qū)挾菮propertyCGFloatborderWidth;//圓角半徑@propertyCGFloatcornerRadius;//內(nèi)容(比如設(shè)置為圖片CGImageRef)@property(retain)idcontents;

說明:可以通過設(shè)置contents屬性給UIView設(shè)置背景圖片,注意必須是CGImage才能顯示,我們可以在UIImage對象后面加上.CGImage直接轉(zhuǎn)換,轉(zhuǎn)換之后還需要在前面加上(id)進(jìn)行強(qiáng)轉(zhuǎn)。

// 跨框架賦值需要進(jìn)行橋接self.view.layer.contents = (__bridgeid_Nullable)([UIImageimageNamed:@"123"].CGImage);

值得注意的是,UIView的CALayer對象(層)通過layer屬性可以訪問這個層。要注意的是,這個默認(rèn)的層不允許重新創(chuàng)建,但可以往層里面添加子層。UIView可以通過addSubview:方法添加子視圖,類似地,CALayer可以通過addSublayer:方法添加子層

CALayer對象有兩個比較重要的屬性,那就是position和anchorPoint。

position和anchorPoint屬性都是CGPoint類型的

position可以用來設(shè)置CALayer在父層中的位置,它是以父層的左上角為坐標(biāo)原點(0, 0)

anchorPoint稱為"定位點",它決定著CALayer身上的哪個點會在position屬性所指的位置。它的x、y取值范圍都是0~1,默認(rèn)值為(0.5, 0.5)

1.創(chuàng)建一個CALayer,添加到控制器的view的layer中

CALayer*myLayer = [CALayerlayer];// 設(shè)置層的寬度和高度(100x100)myLayer.bounds =CGRectMake(0,0,100,100);// 設(shè)置層的位置myLayer.position =CGPointMake(100,100);// 設(shè)置層的背景顏色:紅色myLayer.backgroundColor = [UIColorredColor].CGColor;// 添加myLayer到控制器的view的layer中[self.view.layer addSublayer:myLayer];

第5行設(shè)置了myLayer的position為(100, 100),又因為anchorPoint默認(rèn)是(0.5, 0.5),所以最后的效果是:myLayer的中點會在父層的(100, 100)位置

情況1.png

注意,藍(lán)色線是我自己加上去的,方便大家理解,并不是默認(rèn)的顯示效果。兩條藍(lán)色線的寬度均為100。

2.若將anchorPoint改為(0, 0),myLayer的左上角會在(100, 100)位置

1 myLayer.anchorPoint = CGPointMake(0, 0);

情況2.png

3.若將anchorPoint改為(1, 1),myLayer的右下角會在(100, 100)位置

1 myLayer.anchorPoint = CGPointMake(1, 1);

情況3.png

4.將anchorPoint改為(0, 1),myLayer的左下角會在(100, 100)位置

1 myLayer.anchorPoint = CGPointMake(0, 1);

情況4.png

我想,你應(yīng)該已經(jīng)大概明白anchorPoint的用途了吧,它決定著CALayer身上的哪個點會在position所指定的位置上。它的x、y取值范圍都是0~1,默認(rèn)值為(0.5, 0.5),因此,默認(rèn)情況下,CALayer的中點會在position所指定的位置上。當(dāng)anchorPoint為其他值時,以此類推。

anchorPoint是視圖的中心點,position是視圖的位置,位置會和中心點重疊。所以我們在開發(fā)中可以通過修改視圖的layer.anchorPoint或者layer.position實現(xiàn)特定的動畫效果。

下面舉個兩個??

兩份代碼,上面那個是anchorPoint為(0.5, 0.5)也就是默認(rèn)情況下,下面那個是(0, 0)。

anchorPoint(0.5,0.5).gif

代碼如下:

self.redView.layer.anchorPoint =CGPointMake(0.5,0.5);? ? [UIViewanimateWithDuration:3.0animations:^{self.redView.transform =CGAffineTransformMakeRotation(M_PI);? ? } completion:^(BOOLfinished) {? ? ? ? ? ? }];

anchorPoint(0,0).gif

代碼如下:

self.redView.layer.anchorPoint =CGPointMake(0,0);? ? [UIViewanimateWithDuration:3.0animations:^{self.redView.transform =CGAffineTransformMakeRotation(M_PI);? ? } completion:^(BOOLfinished) {? ? ? ? ? ? }];

隱式動畫

根層與非根層:

每一個UIView內(nèi)部都默認(rèn)關(guān)聯(lián)著一個CALayer,我們可用稱這個Layer為Root Layer(根層)

所有的非Root Layer,也就是手動創(chuàng)建的CALayer對象,都存在著隱式動畫

當(dāng)對非Root Layer的部分屬性進(jìn)行修改時,默認(rèn)會自動產(chǎn)生一些動畫效果,而這些屬性稱為Animatable Properties(可動畫屬性)。

常見的幾個可動畫屬性:

bounds:用于設(shè)置CALayer的寬度和高度。修改這個屬性會產(chǎn)生縮放動畫backgroundColor:用于設(shè)置CALayer的背景色。修改這個屬性會產(chǎn)生背景色的漸變動畫position:用于設(shè)置CALayer的位置。修改這個屬性會產(chǎn)生平移動畫

可以通過事務(wù)關(guān)閉隱式動畫:

[CATransactionbegin];// 關(guān)閉隱式動畫[CATransactionsetDisableActions:YES];self.myview.layer.position =CGPointMake(10,10);[CATransactioncommit];

扯得有點遠(yuǎn)了,我們繼續(xù)回到主題,下面正式介紹核心動畫。

Core Animation簡介

Core Animation,中文翻譯為核心動畫,它是一組非常強(qiáng)大的動畫處理API,使用它能做出非常炫麗的動畫效果,而且往往是事半功倍。也就是說,使用少量的代碼就可以實現(xiàn)非常強(qiáng)大的功能。

Core Animation可以用在Mac OS X和iOS平臺。

Core Animation的動畫執(zhí)行過程都是在后臺操作的,不會阻塞主線程。

要注意的是,Core Animation是直接作用在CALayer上的,并非UIView。

喬幫主在2007年的WWDC大會上親自為你演示Core Animation的強(qiáng)大:點擊查看視頻

核心動畫

如果是xcode5之前的版本,使用它需要先添加QuartzCore.framework和引入對應(yīng)的框架

開發(fā)步驟:

1.使用它需要先添加QuartzCore.framework框架和引入主頭文件

2.初始化一個CAAnimation對象,并設(shè)置一些動畫相關(guān)屬性

3.通過調(diào)用CALayer的addAnimation:forKey:方法增加CAAnimation對象到CALayer中,這樣就能開始執(zhí)行動畫了

4.通過調(diào)用CALayer的removeAnimationForKey:方法可以停止CALayer中的動畫

**

CAAnimation繼承結(jié)構(gòu).png

**

CAAnimation——所有動畫對象的父類

是所有動畫對象的父類,負(fù)責(zé)控制動畫的持續(xù)時間和速度,是個抽象類,不能直接使用,應(yīng)該使用它具體的子類

屬性說明:(帶*號代表來自CAMediaTiming協(xié)議的屬性)

*duration:動畫的持續(xù)時間

*repeatCount:重復(fù)次數(shù),無限循環(huán)可以設(shè)置HUGE_VALF或者M(jìn)AXFLOAT

*repeatDuration:重復(fù)時間

removedOnCompletion:默認(rèn)為YES,代表動畫執(zhí)行完畢后就從圖層上移除,圖形會恢復(fù)到動畫執(zhí)行前的狀態(tài)。如果想讓圖層保持顯示動畫執(zhí)行后的狀態(tài),那就設(shè)置為NO,不過還要設(shè)置fillMode為kCAFillModeForwards

*fillMode:決定當(dāng)前對象在非active時間段的行為。比如動畫開始之前或者動畫結(jié)束之后

*beginTime:可以用來設(shè)置動畫延遲執(zhí)行時間,若想延遲2s,就設(shè)置為CACurrentMediaTime()+2,CACurrentMediaTime()為圖層的當(dāng)前時間

timingFunction:速度控制函數(shù),控制動畫運(yùn)行的節(jié)奏

delegate:動畫代理

CAAnimation——動畫填充模式

fillMode屬性值(要想fillMode有效,最好設(shè)置removedOnCompletion = NO)

kCAFillModeRemoved 這個是默認(rèn)值,也就是說當(dāng)動畫開始前和動畫結(jié)束后,動畫對layer都沒有影響,動畫結(jié)束后,layer會恢復(fù)到之前的狀態(tài)

kCAFillModeForwards 當(dāng)動畫結(jié)束后,layer會一直保持著動畫最后的狀態(tài)

kCAFillModeBackwards 在動畫開始前,只需要將動畫加入了一個layer,layer便立即進(jìn)入動畫的初始狀態(tài)并等待動畫開始。

kCAFillModeBoth 這個其實就是上面兩個的合成.動畫加入后開始之前,layer便處于動畫初始狀態(tài),動畫結(jié)束后layer保持動畫最后的狀態(tài)

CAAnimation——速度控制函數(shù)

速度控制函數(shù)(CAMediaTimingFunction)

kCAMediaTimingFunctionLinear(線性):勻速,給你一個相對靜態(tài)的感覺

kCAMediaTimingFunctionEaseIn(漸進(jìn)):動畫緩慢進(jìn)入,然后加速離開

kCAMediaTimingFunctionEaseOut(漸出):動畫全速進(jìn)入,然后減速的到達(dá)目的地

kCAMediaTimingFunctionEaseInEaseOut(漸進(jìn)漸出):動畫緩慢的進(jìn)入,中間加速,然后減速的到達(dá)目的地。這個是默認(rèn)的動畫行為。

設(shè)置動畫的執(zhí)行節(jié)奏

anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];

CAAnimation——動畫代理方法

CAAnimation在分類中定義了代理方法,是給NSObject添加的分類,所以任何對象,成為CAAnimation的代理都可以

@interfaceNSObject(CAAnimationDelegate)/* Called when the animation begins its active duration. */動畫開始的時候調(diào)用- (void)animationDidStart:(CAAnimation*)anim;動畫停止的時候調(diào)用- (void)animationDidStop:(CAAnimation*)anim finished:(BOOL)flag;@end

CALayer上動畫的暫停和恢復(fù)

#pragma mark 暫停CALayer的動畫-(void)pauseLayer:(CALayer*)layer{CFTimeIntervalpausedTime = [layer convertTime:CACurrentMediaTime() fromLayer:nil];? ? ? ? 讓CALayer的時間停止走動? ? layer.speed =0.0;? ? 讓CALayer的時間停留在pausedTime這個時刻? ? layer.timeOffset = pausedTime;}

CALayer上動畫的恢復(fù)

#pragma mark 恢復(fù)CALayer的動畫-(void)resumeLayer:(CALayer*)layer{CFTimeIntervalpausedTime = layer.timeOffset;1.讓CALayer的時間繼續(xù)行走? ? layer.speed =1.0;2.取消上次記錄的停留時刻? ? layer.timeOffset =0.0;3.取消上次設(shè)置的時間? ? layer.beginTime =0.0;4.計算暫停的時間(這里也可以用CACurrentMediaTime()-pausedTime)CFTimeIntervaltimeSincePause = [layer convertTime:CACurrentMediaTime() fromLayer:nil] - pausedTime;5.設(shè)置相對于父坐標(biāo)系的開始時間(往后退timeSincePause)? ? layer.beginTime = timeSincePause;}

CAPropertyAnimation

是CAAnimation的子類,也是個抽象類,要想創(chuàng)建動畫對象,應(yīng)該使用它的兩個子類:

CABasicAnimation

CAKeyframeAnimation

屬性說明:

keyPath:通過指定CALayer的一個屬性名稱為keyPath(NSString類型),并且對CALayer的這個屬性的值進(jìn)行修改,達(dá)到相應(yīng)的動畫效果。比如,指定@“position”為keyPath,就修改CALayer的position屬性的值,以達(dá)到平移的動畫效果

CABasicAnimation——基本動畫

基本動畫,是CAPropertyAnimation的子類

屬性說明:

keyPath:要改變的屬性名稱(傳字符串)

fromValue:keyPath相應(yīng)屬性的初始值

toValue:keyPath相應(yīng)屬性的結(jié)束值

動畫過程說明:

隨著動畫的進(jìn)行,在長度為duration的持續(xù)時間內(nèi),keyPath相應(yīng)屬性的值從fromValue漸漸地變?yōu)閠oValue

keyPath內(nèi)容是CALayer的可動畫Animatable屬性

如果fillMode=kCAFillModeForwards同時removedOnComletion=NO,那么在動畫執(zhí)行完畢后,圖層會保持顯示動畫執(zhí)行后的狀態(tài)。但在實質(zhì)上,圖層的屬性值還是動畫執(zhí)行前的初始值,并沒有真正被改變。

//創(chuàng)建動畫CABasicAnimation*anim = [CABasicAnimationanimation];;//? ? 設(shè)置動畫對象keyPath決定了執(zhí)行怎樣的動畫,調(diào)用layer的哪個屬性來執(zhí)行動畫? ? ? ? ? position:平移? ? anim.keyPath =@"position";//? ? 包裝成對象anim.fromValue = [NSValuevalueWithCGPoint:CGPointMake(0,0)];;? ? anim.toValue = [NSValuevalueWithCGPoint:CGPointMake(200,300)];? ? anim.duration =2.0;//? ? 讓圖層保持動畫執(zhí)行完畢后的狀態(tài)//? ? 執(zhí)行完畢以后不要刪除動畫anim.removedOnCompletion =NO;//? ? 保持最新的狀態(tài)anim.fillMode = kCAFillModeForwards;//? ? 添加動畫[self.layer addAnimation:anim forKey:nil];

舉個??:

CABasicAnimation.gif

代碼如下:

//創(chuàng)建動畫對象CABasicAnimation*anim = [CABasicAnimationanimation];//設(shè)置動畫屬性anim.keyPath =@"position.y";? ? anim.toValue = @300;//動畫提交時,會自動刪除動畫anim.removedOnCompletion =NO;//設(shè)置動畫最后保持狀態(tài)anim.fillMode = kCAFillModeForwards;//添加動畫對象[self.redView.layer addAnimation:anim forKey:nil];

CAKeyframeAnimation——關(guān)鍵幀動畫

關(guān)鍵幀動畫,也是CAPropertyAnimation的子類,與CABasicAnimation的區(qū)別是:

CABasicAnimation只能從一個數(shù)值(fromValue)變到另一個數(shù)值(toValue),而CAKeyframeAnimation會使用一個NSArray保存這些數(shù)值

屬性說明:

values:上述的NSArray對象。里面的元素稱為“關(guān)鍵幀”(keyframe)。動畫對象會在指定的時間(duration)內(nèi),依次顯示values數(shù)組中的每一個關(guān)鍵幀

path:代表路徑可以設(shè)置一個CGPathRef、CGMutablePathRef,讓圖層按照路徑軌跡移動。path只對CALayer的

anchorPoint和position起作用。如果設(shè)置了path,那么values將被忽略

keyTimes:可以為對應(yīng)的關(guān)鍵幀指定對應(yīng)的時間點,其取值范圍為0到1.0,keyTimes中的每一個時間值都對應(yīng)values中的每一幀。如果沒有設(shè)置keyTimes,各個關(guān)鍵幀的時間是平分的

CABasicAnimation可看做是只有2個關(guān)鍵幀的CAKeyframeAnimation

//? ? 創(chuàng)建動畫CAKeyframeAnimation*anim = [CAKeyframeAnimationanimation];;//? ? 設(shè)置動畫對象//? keyPath決定了執(zhí)行怎樣的動畫,調(diào)整哪個屬性來執(zhí)行動畫anim.keyPath =@"position";NSValue*v1 = [NSValuevalueWithCGPoint:CGPointMake(100,0)];NSValue*v2 = [NSValuevalueWithCGPoint:CGPointMake(200,0)];NSValue*v3 = [NSValuevalueWithCGPoint:CGPointMake(300,0)];NSValue*v4 = [NSValuevalueWithCGPoint:CGPointMake(400,0)];? ? anim.values = @[v1,v2,v3,v4];? anim.duration =2.0;//? ? 讓圖層保持動畫執(zhí)行完畢后的狀態(tài)//? ? 狀態(tài)執(zhí)行完畢后不要刪除動畫anim.removedOnCompletion =NO;//? ? 保持最新的狀態(tài)anim.fillMode = kCAFillModeForwards;//? ? 添加動畫[self.layer addAnimation:anim forKey:nil];//? 根據(jù)路徑創(chuàng)建動畫//? ? 創(chuàng)建動畫CAKeyframeAnimation*anim = [CAKeyframeAnimationanimation];;? anim.keyPath =@"position";? anim.removedOnCompletion =NO;? anim.fillMode = kCAFillModeForwards;? anim.duration =2.0;//? ? 創(chuàng)建一個路徑CGMutablePathRefpath =CGPathCreateMutable();//? ? 路徑的范圍CGPathAddEllipseInRect(path,NULL,CGRectMake(100,100,200,200));//? ? 添加路徑anim.path = path;//? ? 釋放路徑(帶Create的函數(shù)創(chuàng)建的對象都需要手動釋放,否則會內(nèi)存泄露)CGPathRelease(path);//? ? 添加到View的layer[self.redView.layer addAnimation:anim forKey];

舉個??:

CAKeyframeAnimation.gif

代碼如下:

//幀動畫CAKeyframeAnimation*anim = [CAKeyframeAnimationanimation];? ? anim.keyPath =@"transform.rotation";? ? anim.values = @[@(angle2Radio(-5)),@(angle2Radio(5)),@(angle2Radio(-5))];? ? ? ? anim.repeatCount = MAXFLOAT;//自動反轉(zhuǎn)//anim.autoreverses = YES;[self.imageV.layer addAnimation:anim forKey:nil];

再舉個??:

CAKeyframeAnimation(路徑動畫).gif

代碼如下:

#import"ViewController.h"@interfaceViewController()/** 注釋*/@property(nonatomic,weak)CALayer*fistLayer;@property(strong,nonatomic)NSMutableArray*imageArray;@end@implementationViewController- (void)viewDidLoad {? ? [superviewDidLoad];//設(shè)置背景self.view.layer.contents = (id)[UIImageimageNamed:@"bg"].CGImage;CALayer*fistLayer = [CALayerlayer];? ? fistLayer.frame =CGRectMake(100,288,89,40);//fistLayer.backgroundColor = [UIColor redColor].CGColor;[self.view.layer addSublayer:fistLayer];self.fistLayer = fistLayer;//fistLayer.transform = CATransform3DMakeRotation(M_PI, 0, 0, 1);//加載圖片NSMutableArray*imageArray = [NSMutableArrayarray];for(inti =0; i <10; i++) {UIImage*image = [UIImageimageNamed:[NSStringstringWithFormat:@"fish%d",i]];? ? ? ? [imageArray addObject:image];? ? }self.imageArray = imageArray;//添加定時器[NSTimerscheduledTimerWithTimeInterval:0.1target:selfselector:@selector(update) userInfo:nilrepeats:YES];//添加動畫CAKeyframeAnimation*anim = [CAKeyframeAnimationanimation];? ? anim.keyPath =@"position";UIBezierPath*path = [UIBezierPathbezierPath];? ? [path moveToPoint:CGPointMake(100,200)];? ? [path addLineToPoint:CGPointMake(350,200)];? ? [path addLineToPoint:CGPointMake(350,500)];? ? [path addQuadCurveToPoint:CGPointMake(100,200) controlPoint:CGPointMake(150,700)];//傳入路徑anim.path = path.CGPath;? ? ? ? anim.duration? =5;? ? ? ? anim.repeatCount = MAXFLOAT;? ? ? ? anim.calculationMode =@"cubicPaced";? ? ? ? anim.rotationMode =@"autoReverse";? ? ? ? [fistLayer addAnimation:anim forKey:nil];}staticint_imageIndex =0;- (void)update {//從數(shù)組當(dāng)中取出圖片UIImage*image =self.imageArray[_imageIndex];self.fistLayer.contents = (id)image.CGImage;? ? _imageIndex++;if(_imageIndex >9) {? ? ? ? _imageIndex =0;? ? }}@end

轉(zhuǎn)場動畫——CATransition

CATransition是CAAnimation的子類,用于做轉(zhuǎn)場動畫,能夠為層提供移出屏幕和移入屏幕的動畫效果。iOS比Mac OS X的轉(zhuǎn)場動畫效果少一點

UINavigationController就是通過CATransition實現(xiàn)了將控制器的視圖推入屏幕的動畫效果

動畫屬性:(有的屬性是具備方向的,詳情看下圖)

type:動畫過渡類型

subtype:動畫過渡方向

startProgress:動畫起點(在整體動畫的百分比)

endProgress:動畫終點(在整體動畫的百分比)

轉(zhuǎn)場動畫過渡效果.png

CATransition*anim = [CATransitionanimation];? ? 轉(zhuǎn)場類型? ? anim.type =@"cube";? ? 動畫執(zhí)行時間? ? anim.duration =0.5;? ? 動畫執(zhí)行方向? ? anim.subtype = kCATransitionFromLeft;? ? 添加到View的layer? ? [self.redView.layer addAnimation:anim forKey];

舉個??:

CATransition.gif

#import"ViewController.h"@interfaceViewController()@property(weak,nonatomic)IBOutletUIImageView*imageV;@end@implementationViewController- (void)viewDidLoad {? ? [superviewDidLoad];self.imageV.userInteractionEnabled =YES;//添加手勢UISwipeGestureRecognizer*leftSwipe = [[UISwipeGestureRecognizeralloc] initWithTarget:selfaction:@selector(swipe:)];? ? leftSwipe.direction =UISwipeGestureRecognizerDirectionLeft;? ? [self.imageV addGestureRecognizer:leftSwipe];UISwipeGestureRecognizer*rightSwipe = [[UISwipeGestureRecognizeralloc] initWithTarget:selfaction:@selector(swipe:)];? ? ? ? rightSwipe.direction =UISwipeGestureRecognizerDirectionRight;? ? [self.imageV addGestureRecognizer:rightSwipe];? ? }staticint_imageIndex =0;- (void)swipe:(UISwipeGestureRecognizer*)swipe {//轉(zhuǎn)場代碼與轉(zhuǎn)場動畫必須得在同一個方法當(dāng)中.NSString*dir =nil;if(swipe.direction ==UISwipeGestureRecognizerDirectionLeft) {? ? ? ? ? ? ? ? _imageIndex++;if(_imageIndex >4) {? ? ? ? ? ? _imageIndex =0;? ? ? ? }NSString*imageName = [NSStringstringWithFormat:@"%d",_imageIndex];self.imageV.image = [UIImageimageNamed:imageName];? ? ? ? ? ? ? ? dir =@"fromRight";? ? }elseif(swipe.direction ==UISwipeGestureRecognizerDirectionRight) {? ? ? ? _imageIndex--;if(_imageIndex <0) {? ? ? ? ? ? _imageIndex =4;? ? ? ? }NSString*imageName = [NSStringstringWithFormat:@"%d",_imageIndex];self.imageV.image = [UIImageimageNamed:imageName];? ? ? ? ? ? ? ? dir =@"fromLeft";? ? }//添加動畫CATransition*anim = [CATransitionanimation];//設(shè)置轉(zhuǎn)場類型anim.type =@"cube";//設(shè)置轉(zhuǎn)場的方向anim.subtype = dir;? ? ? ? anim.duration =0.5;//動畫從哪個點開始//? ? anim.startProgress = 0.2;//? ? anim.endProgress = 0.3;[self.imageV.layer addAnimation:anim forKey:nil];? ? ? ? }- (void)didReceiveMemoryWarning {? ? [superdidReceiveMemoryWarning];// Dispose of any resources that can be recreated.}@end

CAAnimationGroup——動畫組

動畫組,是CAAnimation的子類,可以保存一組動畫對象,將CAAnimationGroup對象加入層后,組中所有動畫對象可以同時并發(fā)運(yùn)行

屬性說明:

animations:用來保存一組動畫對象的NSArray

默認(rèn)情況下,一組動畫對象是同時運(yùn)行的,也可以通過設(shè)置動畫對象的beginTime屬性來更改動畫的開始時間

CAAnimationGroup*group = [CAAnimationGroupanimation];//? ? 創(chuàng)建旋轉(zhuǎn)動畫對象CABasicAnimation*retate = [CABasicAnimationanimation];//? ? layer的旋轉(zhuǎn)屬性retate.keyPath =@"transform.rotation";//? ? 角度retate.toValue = @(M_PI);//? ? 創(chuàng)建縮放動畫對象CABasicAnimation*scale = [CABasicAnimationanimation];//? ? 縮放屬性scale.keyPath =@"transform.scale";//? ? 縮放比例scale.toValue = @(0.0);//? ? 添加到動畫組當(dāng)中g(shù)roup.animations = @[retate,scale];//? ? ? ? ? 執(zhí)行動畫時間group.duration =2.0;//? ? 執(zhí)行完以后不要刪除動畫group.removedOnCompletion =NO;//? ? ? ? ? 保持最新的狀態(tài)group.fillMode = kCAFillModeForwards;? ? [self.view.layer addAnimation:group forKey:nil];

舉個??:

CAAnimationGroup.gif

代碼如下:

#import"ViewController.h"@interfaceViewController()@property(weak,nonatomic)IBOutletUIView*redView;@end@implementationViewController- (void)viewDidLoad {? ? [superviewDidLoad];// Do any additional setup after loading the view, typically from a nib.}- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent*)event {//移動CABasicAnimation*anim = [CABasicAnimationanimation];? ? anim.keyPath =@"position.y";? ? anim.toValue = @500;//? ? anim.removedOnCompletion = NO;//? ? anim.fillMode = kCAFillModeForwards;//? ? [self.redView.layer addAnimation:anim forKey:nil];//? ? //縮放CABasicAnimation*anim2 = [CABasicAnimationanimation];? ? anim2.keyPath =@"transform.scale";? ? anim2.toValue = @0.5;//? ? anim2.removedOnCompletion = NO;//? ? anim2.fillMode = kCAFillModeForwards;//? ? [self.redView.layer addAnimation:anim2 forKey:nil];CAAnimationGroup*groupAnim = [CAAnimationGroupanimation];//會執(zhí)行數(shù)組當(dāng)中每一個動畫對象groupAnim.animations = @[anim,anim2];? ? groupAnim.removedOnCompletion =NO;? ? groupAnim.fillMode = kCAFillModeForwards;? ? [self.redView.layer addAnimation:groupAnim forKey:nil];? ? }- (void)didReceiveMemoryWarning {? ? [superdidReceiveMemoryWarning];// Dispose of any resources that can be recreated.}@end

三大動畫:(不需要交互的時候可以選擇以下動畫)

CAAnimationGroup——動畫組

CAKeyframeAnimation——關(guān)鍵幀動畫

轉(zhuǎn)場動畫——CATransition

使用UIView動畫函數(shù)實現(xiàn)轉(zhuǎn)場動畫——單視圖

//參數(shù)說明:duration:動畫的持續(xù)時間 view:需要進(jìn)行轉(zhuǎn)場動畫的視圖 options:轉(zhuǎn)場動畫的類型 animations:將改變視圖屬性的代碼放在這個block中 completion:動畫結(jié)束后,會自動調(diào)用這個block + (void)transitionWithView:(UIView*)view duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options animations:(void(^)(void))animations completion:(void(^)(BOOLfinished))completion;

使用UIView動畫函數(shù)實現(xiàn)轉(zhuǎn)場動畫——雙視圖

參數(shù)說明:duration:動畫的持續(xù)時間options:轉(zhuǎn)場動畫的類型animations:將改變視圖屬性的代碼放在這個block中completion:動畫結(jié)束后,會自動調(diào)用這個block+ (void)transitionFromView:(UIView*)fromView toView:(UIView*)toView duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options completion:(void(^)(BOOLfinished))completion;

轉(zhuǎn)場動畫

1.創(chuàng)建轉(zhuǎn)場動畫:[CATransition animation];

2.設(shè)置動畫屬性值

3.添加到需要專場動畫的圖層上 [ layer addAimation:animation forKer:nil];

轉(zhuǎn)場動畫的類型(NSString *type)fade : 交叉淡化過渡push : 新視圖把舊視圖推出去moveIn: 新視圖移到舊視圖上面reveal: 將舊視圖移開,顯示下面的新視圖cube : 立方體翻滾效果oglFlip : 上下左右翻轉(zhuǎn)效果suckEffect : 收縮效果,如一塊布被抽走rippleEffect: 水滴效果pageCurl : 向上翻頁效果pageUnCurl : 向下翻頁效果cameraIrisHollowOpen : 相機(jī)鏡頭打開效果cameraIrisHollowClos : 相機(jī)鏡頭關(guān)閉效果

注意:核心動畫只是修改了控件的圖形樹,換句話說就是只是修改了他的顯示,并沒有改變控件的真實位置?。?!也就是說在動畫的過程中點擊控件是不能跟用戶進(jìn)行交互的,切記切記?。。‘?dāng)然,點擊控件的起始位置是可以的。

3.幀動畫

這里講的幀動畫是指UIIMageView自帶的動畫。順帶跟大家講下怎么將一個git動態(tài)圖里面的圖片取出來,并加以顯示。

動畫屬性:

@property(nonatomic)NSTimeIntervalanimationDuration;// for one cycle of images. default is number of images * 1/30th of a second (i.e. 30 fps)@property(nonatomic)NSIntegeranimationRepeatCount;// 0 means infinite (default is 0)

舉個??:

幀動畫.gif

代碼如下:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent*)event{NSArray*imageArray = [selfgetImageArrayWithGIFNameWit:@"aisi"];self.imageView.animationImages = imageArray;self.imageView.animationDuration =3;self.imageView.animationRepeatCount = MAXFLOAT;? ? [self.imageView startAnimating];? ? ? ? dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5.0*NSEC_PER_SEC)), dispatch_get_main_queue(), ^{? ? ? ? ? ? ? ? [_imageView stopAnimating];? ? });}- (NSArray *)getImageArrayWithGIFNameWit:(NSString*)imageName {NSMutableArray*imageArray = [NSMutableArrayarray];NSString*path = [[NSBundlemainBundle] pathForResource:imageName ofType:@"gif"];NSData*data = [NSDatadataWithContentsOfFile:path];if(!data) {NSLog(@"圖片不存在!");returnnil;? ? }CGImageSourceRefsource =CGImageSourceCreateWithData((__bridgeCFDataRef)data,NULL);? ? ? ? size_t count =CGImageSourceGetCount(source);if(count <=1) {? ? ? ? [imageArray addObject:[[UIImagealloc] initWithData:data]];? ? }else{for(size_t i =0; i < count; i++) {CGImageRefimage =CGImageSourceCreateImageAtIndex(source, i,NULL);? ? ? ? ? ? ? ? ? ? ? ? [imageArray addObject:[UIImageimageWithCGImage:image scale:[UIScreenmainScreen].scale orientation:UIImageOrientationUp]];CGImageRelease(image);? ? ? ? }? ? }CFRelease(source);returnimageArray;}

作者:moxuyou

鏈接:http://www.itdecent.cn/p/9fa025c42261

來源:簡書

著作權(quán)歸作者所有。商業(yè)轉(zhuǎn)載請聯(lián)系作者獲得授權(quán),非商業(yè)轉(zhuǎn)載請注明出處。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容