具体过程可以参考:《为毛矢量图图标还发虚?》
这里只贴结论:
- 设置 ImageView 的 ScaleType 为 ScaleType.FIT_XY 即可。
- 或者 把 height 和 width 设置为一个较大的值,避免图标放大发虚
<vector android:height="120dp" android:viewportHeight="75.0" android:viewportWidth="75.0" android:width="120dp" xmlns:android="http://schemas.android.com/apk/res/android"> <path android:fillColor="#FF000000" android:pathData="..." /> </vector> Read more: http://blog.chengyunfeng.com/?p=999#ixzz4iuNHl4tA