使用新的api21,您可以使用VectorDrawables执行您想要的操作.这是一个例子:
这将使用如下的可绘制向量:
android:height="32dp"
android:width="32dp"
android:viewportHeight="200"
android:viewportWidth="200">
android:fillColor="@android:color/black"
android:pathData="M 28.53,92.12
C 27.92,92.12 27.56,91.64 27.56,91.09
27.56,90.52 27.92,90.00 28.50,90.00
28.50,90.00 41.73,90.00 41.73,90.00
42.31,90.00 42.67,90.52 42.67,91.09
42.67,91.64 42.28,92.12 41.73,92.12
41.73,92.12 36.31,92.12 36.31,92.12
36.31,92.12 36.31,108.02 36.31,108.02
36.31,108.67 35.78,109.00 35.12,109.00
34.48,109.00 33.94,108.67 33.94,108.02
33.94,108.02 33.94,92.12 33.94,92.12
33.94,92.12 28.53,92.12 28.53,92.12 Z
M 55.80,108.11
C 55.80,108.72 55.28,109.00 54.66,109.00
54.02,109.00 53.55,108.72 53.55,108.11
53.55,108.11 53.55,100.94 53.55,100.94
53.55,99.03 52.73,97.97 50.94,97.97
49.59,97.97 48.56,98.56 47.77,99.55
47.17,100.31 46.92,100.95 46.92,101.83
46.92,101.83 46.92,108.11 46.92,108.11
46.92,108.72 46.47,109.00 45.84,109.00
45.17,109.00 44.69,108.72 44.69,108.11
44.69,108.11 44.69,91.09 44.69,91.09
44.69,90.38 45.17,90.00 45.84,90.00
46.47,90.00 46.92,90.34 46.92,91.09
46.92,91.09 46.92,97.77 46.92,97.77
46.92,98.06 46.81,98.58 46.77,98.92
46.77,98.92 46.70,98.89 46.70,98.89
47.50,97.25 48.84,96.00 51.38,96.00
54.22,96.00 55.80,97.73 55.80,100.52
55.80,100.52 55.80,108.11 55.80,