如何在晶圆厂内绘制矢量?(Android:色调似乎不起作用)



由于某种原因, android:tint xml属性实际上不会 tint 我的向量可绘制。

fab布局

<com.google.android.material.floatingactionbutton.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="end|bottom"
    android:layout_margin="16dp"
    android:tint="@android:color/holo_blue_light"
    android:src="@drawable/ic_favourite_empty"
    app:rippleColor="?colorSecondaryVariantLight"/>  

向量绘制

<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
    android:fillColor="#000000"
    android:pathData="M19.66 3.99c-2.64-1.8-5.9-.96-7.66 1.1-1.76-2.06-5.02-2.91-7.66-1.1-1.4.96-2.28 2.58-2.34 4.29-.14 3.88 3.3 6.99 8.55 11.76l.1.09c.76.69 1.93.69 2.69-.01l.11-.1c5.25-4.76 8.68-7.87 8.55-11.75-.06-1.7-.94-3.32-2.34-4.28zM12.1 18.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"/>


如果我删除fillColor,则根本看不到图标,如果将其更改为其他颜色,它仍然会保持黑色。我可以更改其颜色的唯一方法是更改App主题内的colorOnSecondary XML属性(我不想这样做)。

请建议。

我找到了解决方案,如果有人需要:使用app:tint代替android:tint
欢呼。

最新更新