2014/09/01

Android 動畫 Property Animation 基本概念

Android 提供了三種動畫系統: Property Animation (從 3.0 開始) 和 View Animation ,另外一種是讀取 drawable 資源來顯示 (Drawable Animation),一般而言通常建議使用 property animation。

Property Animation 系統能夠讓你定義下列幾項功能
Duration, Time interpolation, Repeat count and behavior, Animator sets, Frame refresh delay

啟動動畫的方法:建立一個 ValueAnimator 物件,然後給予它開始和結束的數值。
ValueAnimator 物件持續的追蹤你的動畫物件,它包含了一個 TimeInterpolator 物件來定義動畫的 Interpolation

Property Animation 和 View Animation 的比較

- View Animation 只能對 View 物件進行動畫
- View Animation 只能進行少數的動畫效果
- View Animation 並非真正修改 View 本身,例如將一個按扭進行在畫面上的動畫時,它雖然被繪圖正確,但它實際的位置上並沒有改變(邏輯位置),也就是說事件處發位置仍然不變。

No comments:

Post a Comment