iOS 畫面切換的各種動畫效果附私人API

來源:互聯網
上載者:User

ios的畫面切換的動畫效果的API主要通過調用系統已定義的動畫效果實現,這些效果已基本囊括開發的需求,如果需要更加複雜的效果,可以考慮CATransition來實現

以下是基本的四種效果
kCATransitionPush 推入效果
kCATransitionMoveIn 移入效果
kCATransitionReveal 截開效果
kCATransitionFade 漸入漸出效果

以下API效果可以安全使用
cube 方塊
suckEffect 三角
rippleEffect 水波抖動
pageCurl 上翻頁
pageUnCurl 下翻頁
oglFlip 上下翻轉
cameraIrisHollowOpen 鏡頭快門開
cameraIrisHollowClose 鏡頭快門開


以下API效果請慎用
spewEffect 新版面在螢幕下方中間位置被釋放出來覆蓋舊版面.
genieEffect 舊版面在螢幕左下方或右下方被吸走, 顯示出下面的新版面
unGenieEffect 新版面在螢幕左下方或右下方被釋放出來覆蓋舊版面.
twist 版面以水平方向像龍捲風式轉出來.
tubey 版面垂直附有彈性的轉出來.
swirl 舊版面360度旋轉並淡出, 顯示出新版面.
charminUltra 舊版面淡出並顯示新版面.
zoomyIn 新版面由小放大走到前面, 舊版面放大由前面消失.
zoomyOut 新版面螢幕外面縮放出現, 舊版面縮小消失.
oglApplicationSuspend 像按”home” 按鈕的效果.

動畫效果的用法

 代碼如下 複製代碼

CATransition *animation = [CATransition animation];
animation.duration = 10.5f;
animation.timingFunction = UIViewAnimationCurveEaseInOut;
animation.fillMode = kCAFillModeForwards;
//基本型
animation.type = kCATransitionPush;
//私人API,字串型
animation.type = "cube"; 
[self.view.layer addAnimation:animation forKey:@"animation"];

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.