Issue
I am creating a widget, but when I add app:tint="@color/white" it's showing tint in the Design Preview but when the widget loads the tint is not applied, the icon is still black, i need to add white tint to the imageview.
<ImageView
android:id="@+id/imageView1"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentEnd="true"
android:elevation="10dp"
android:src="@drawable/ic_explore_01"
app:tint="@color/white" />
Solution
Open your ic_explore_01 xml file and edit the fillColor like the below code snippet.
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="@color/white"
android:pathData="M3,13h8L11,3L3,3v10zM3,21h8v-6L3,15v6zM13,21h8L21,11h-8v10zM13,3v6h8L21,3h-8z" />
</vector>
Answered By - Kakyire
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.