1
我有以下繪製red_dot.xml:應用動畫集塑造繪製
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" >
<solid android:color="#f00" />
<size
android:width="30dp"
android:height="30dp"/>
</shape>
和動畫pulse.xml:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha
android:fromAlpha="1.0"
android:toAlpha="0.0"
android:duration="1000"
android:repeatMode="reverse"
android:repeatCount="infinite" />
</set>
如何申請動畫的繪製在一個XML文件,例如red_dot_animated?如果red_dot.xml是一個矢量文件,下面將有可能(但它不是,因爲我們有一個形狀)
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/red_dot_vector" >
<target
android:name="circle"
android:animation="@anim/pulse" />
</animated-vector>
把它以可抽拉XML將不得不直接使用它的TextView的drawableLeft等方面的優勢.. – PhilLab