Android Animation的XML的编写

2014-11-24 10:09:24 · 作者: · 浏览: 0

在Animation的xml文档的创建:


先在项目的res下创建一个anim文件夹。然后在anim文件夹下创建xml文件。


alpha.xml


rotate.xml


< xml version="1.0" encoding="utf-8" >
xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator"
>
android:fromDegrees="0"
android:toDegrees="+350"
android:pivotX="50%"
android:pivotY="50%"
android:duration="500"
/>


rotatex.ml中的android:pivotX参数的值


1、android.pivotX="50"这种方法使用绝对位置定位
2、android:pivotX="50%"这种方法使用相对于控件本身定位
3、android:pivotX="50%p"这种方法使用相对于控件的父控件定位