Andriod anim scale中的属性介绍以及Animation类的属性
生活随笔
收集整理的這篇文章主要介紹了
Andriod anim scale中的属性介绍以及Animation类的属性
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
ScaleAnimation是Andriod中的補間(Tween)動畫中的大小縮放的動畫
使用時,需要在res下新建Android Resource Directtory,并選擇anim(如已存在就不需要重復建)。在anim文件夾下new一個Animation Resource File,并在Root element中填寫scale即可。
<?xml version="1.0" encoding="utf-8"?> <scale xmlns:android="http://schemas.android.com/apk/res/android" ></scale>scale自有屬性:fromXScale、toXScale、fromYScale、toYScale、pivotX、pivotY。
eg:
上面代碼表示動畫時間為3秒,從原有大小縮小至X方向的十分之一以及Y方向的百分之一,縮放到原view的50%寬高處。fillAfter表示的含義請看Animation類的屬性。
Animation類的屬性
因為alpha、scale、translate、rotate四種動畫都對應著AlphaAnimation、ScaleAnimation、TranslateAnimation、RotateAnimation類,而這四個類都是繼承Animation類,故具有Animation類的屬性。
總結
以上是生活随笔為你收集整理的Andriod anim scale中的属性介绍以及Animation类的属性的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Andriod anim alpha中的
- 下一篇: Andriod anim rotate中