Android中Vector Drawable发虚的解决方法

具体过程可以参考:《为毛矢量图图标还发虚?》

这里只贴结论:

  1. 设置 ImageView 的 ScaleType 为 ScaleType.FIT_XY 即可。
  2. 或者 把 height 和 width 设置为一个较大的值,避免图标放大发虚
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<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
<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
<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

 

Leave a Reply

Your email address will not be published. Required fields are marked *