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