2013-04-05 51 views
2

google API tutorial顯示如何爲視圖添加動畫效果。但是它使用API​​級別爲11的方法,例如View.setAlpha查看API的動畫替代品<11

現在,使用具有android 2.1(API 7)的手機,我可以找到許多使用相同類型動畫的應用程序(卡片翻轉動畫是非常受歡迎)

是否有任何Google庫可以執行本教程中顯示的動畫,可以在11之前的任何API上使用? 如果沒有,還有其他的選擇嗎?

PS我知道this question但appearantly,這是特別爲約objectanimator,就有了一個無用的雁接受

+0

使用nineoldandroids jar它是ObjectAnimator的替代品。 – Jitendra 2013-04-05 12:16:46

回答

0

簡單的動畫,如變換,旋轉,移動(這似乎是你想要的)可能是與這種類製成:

http://developer.android.com/reference/android/view/animation/AnimationUtils.html

http://developer.android.com/reference/android/animation/AnimatorSet.html

http://developer.android.com/reference/android/view/animation/Animation.html

簡而言之,您將創建動畫資源(或類)並在視圖上運行它。在結束動畫之後,可能會通過可見性方法隱藏此視圖。

查看詳情 - http://jmsliu.com/779/android-view-animation-example.html

1

NineOldAndroids將能夠爲您提供您在11+中看到的動畫API。例如...

ViewHelper.setAlpha(view, 0);