Android Studio 3.0 svg圖片問題

陳明明發表於2017-12-14

Svg圖片問題

fillColor屬性不支援引用color資源

如下所示,fillColor屬性使用了colorPrimaryDark會導致編譯器報錯

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0">
    <path
        android:fillColor="@color/colorPrimaryDark"
        android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM10,17l-5,-5 1.41,-1.41L10,14.17l7.59,-7.59L19,8l-9,9z"/>
</vector>

複製程式碼

報錯

相關文章