Drawable tinting for api

Use the AppCompatImageView like so:

<android.support.v7.widget.AppCompatImageView
        android:id="@+id/my_appcompat_imageview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="https://stackoverflow.com/questions/29155463/@drawable/my_image"
        android:tint="#636363"
    />

Make sure you have the latest appcompat-v7 in your app’s build.gradle.

Example: compile 'com.android.support:appcompat-v7:25.0.0' in your app’s build.gradle.

Leave a Comment