首先這個(gè)枚舉屬于UIViewAnimation掂墓。我們經(jīng)常使用的函數(shù)是
[UIView animateWithDuration: animations:^{} completion:^(BOOL finished) {}]
[UIView animateWithDuration: animations:^{}];
如果動(dòng)畫稍微復(fù)雜點(diǎn),例如需要組合等等就可能用到這個(gè)函數(shù):
[UIView animateWithDuration: delay: options: animations: completion:^(BOOL finished) {}];
以上方法中的options一項(xiàng)需要傳入一個(gè)枚舉打掘,這個(gè)枚舉大概控制的是這幾個(gè)要素:當(dāng)前動(dòng)畫嵌套中的動(dòng)畫執(zhí)行隨時(shí)間的快慢種類(先快后慢等..)华畏。動(dòng)畫要一直重復(fù)嗎。如果我使用轉(zhuǎn)場(chǎng)動(dòng)畫那么我用哪種轉(zhuǎn)場(chǎng)效果尊蚁。還有子動(dòng)畫嵌套在父動(dòng)畫中時(shí)我們?nèi)绾螌?duì)待父動(dòng)畫中的相同選項(xiàng)等等..
UIViewAnimationOptionLayoutSubviews //提交動(dòng)畫的時(shí)候布局子控件亡笑,表示子控件將和父控件一同動(dòng)畫。
UIViewAnimationOptionAllowUserInteraction //動(dòng)畫時(shí)允許用戶交流横朋,比如觸摸
UIViewAnimationOptionBeginFromCurrentState //從當(dāng)前狀態(tài)開始動(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)畫將使用快照
UIViewAnimationOptionShowHideTransitionViews //用顯隱的方式替代添加移除圖層的動(dòng)畫效果
UIViewAnimationOptionOverrideInheritedOptions //忽略嵌套繼承的?選項(xiàng)
//時(shí)間函數(shù)曲線相關(guān)
UIViewAnimationOptionCurveEaseInOut //時(shí)間曲線函數(shù),由慢到快
UIViewAnimationOptionCurveEaseIn //時(shí)間曲線函數(shù),由慢到特別快
UIViewAnimationOptionCurveEaseOut //時(shí)間曲線函數(shù)绝骚,由快到慢
UIViewAnimationOptionCurveLinear //時(shí)間曲線函數(shù),勻速
//轉(zhuǎn)場(chǎng)動(dòng)畫相關(guān)的
UIViewAnimationOptionTransitionNone //無轉(zhuǎn)場(chǎng)動(dòng)畫
UIViewAnimationOptionTransitionFlipFromLeft //轉(zhuǎn)場(chǎng)從左翻轉(zhuǎn)
UIViewAnimationOptionTransitionFlipFromRight //轉(zhuǎn)場(chǎng)從右翻轉(zhuǎn)
UIViewAnimationOptionTransitionCurlUp //上卷轉(zhuǎn)場(chǎng)
UIViewAnimationOptionTransitionCurlDown //下卷轉(zhuǎn)場(chǎng)
UIViewAnimationOptionTransitionCrossDissolve //轉(zhuǎn)場(chǎng)交叉消失
UIViewAnimationOptionTransitionFlipFromTop //轉(zhuǎn)場(chǎng)從上翻轉(zhuǎn)
UIViewAnimationOptionTransitionFlipFromBottom //轉(zhuǎn)場(chǎng)從下翻轉(zhuǎn)