iOS動(dòng)畫中的UIViewAnimation里面的枚舉

開發(fā)過程中常用的關(guān)于函數(shù)有以下幾個(gè):

1.[UIView animateWithDuration: animations:^{} completion:^(BOOL finished) {}];

2.[UIView animateWithDuration: animations:^{}];

3.[UIView animateWithDuration: delay: options: animations: completion:^(BOOL finished) {}];

前兩個(gè)動(dòng)畫的函數(shù)的使用,沒有太多的可講.第三個(gè)動(dòng)畫,多了一個(gè)options選項(xiàng).需要我們傳入一個(gè)枚舉,這個(gè)枚舉主要的作用:當(dāng)前的動(dòng)畫執(zhí)行隨時(shí)間函數(shù)變化(由快變慢,由慢變快等...效果).可以實(shí)現(xiàn)類似淡入淡出的效果.

介紹:

UIViewAniOpinionLayoutSubviews //子視圖中控講將跟父視圖中控件使用相同的動(dòng)畫

UIViewAnimationOptionAllowUserInteraction //動(dòng)畫時(shí)允許用戶交互

UIViewAnimationOpinionBeginFromCurrentState //重當(dāng)前狀態(tài)開始執(zhí)行動(dòng)畫

UIViewAnimationOptionRepeat //動(dòng)畫一直重復(fù)播放

UIViewAnimationOptionAutoreverse //執(zhí)行動(dòng)畫回路,前提是設(shè)置動(dòng)畫無限重復(fù)

UIViewAnimationOptionOverrideInheritedDuration //忽略外層動(dòng)畫嵌套的執(zhí)行時(shí)間

UIViewAnimationOptionOverrideInheritedCurve //忽略外層動(dòng)畫嵌套的時(shí)間變化曲線

UIViewAnimationOptionAllowAnimatedContent //通過改變屬性和重繪實(shí)現(xiàn)動(dòng)畫效果,如果key沒有提交動(dòng)畫將使用快照

UIViewAnimationOptionOverrideInheritedOptions //忽略嵌套繼承的?選項(xiàng)

//時(shí)間函數(shù)曲線相關(guān)

UIViewAnimationOptionCurveEaseInOut //時(shí)間曲線函數(shù),由慢到快

UIViewAnimationOptionCurveEaseIn //時(shí)間曲線函數(shù),由慢到特別快

UIViewAnimationOptionCurveEaseOut //時(shí)間曲線函數(shù),由快到慢

UIViewAnimationOptionCurveLinear //時(shí)間曲線函數(shù),勻速

轉(zhuǎn)場動(dòng)畫它一般是用在這個(gè)方法中的:

[UIView transitionFromView: toView: duration: options: completion:^(BOOL finished) {}];

//相關(guān)的轉(zhuǎn)場動(dòng)畫

UIViewAnimationOptionTransitionNone //無轉(zhuǎn)場動(dòng)畫

UIViewAnimationOptionTransitionFlipFromLeft //轉(zhuǎn)場從左翻轉(zhuǎn)

UIViewAnimationOptionTransitionFlipFromRight //轉(zhuǎn)場從右翻轉(zhuǎn)

UIViewAnimationOptionTransitionCurlUp //上卷轉(zhuǎn)場

UIViewAnimationOptionTransitionCurlDown //下卷轉(zhuǎn)場

UIViewAnimationOptionTransitionCrossDissolve //轉(zhuǎn)場交叉消失

UIViewAnimationOptionTransitionFlipFromTop //轉(zhuǎn)場從上翻轉(zhuǎn)

UIViewAnimationOptionTransitionFlipFromBottom //轉(zhuǎn)場從下翻轉(zhuǎn)

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

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

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