图像的矢量可绘制对象包含渐变颜色,对于低于API版本24的图像,它不在imageview中显示,我正在使用Android-Studio 3.1
确保在模块的build.gradle中具有此名称:
vectorDrawables.useSupportLibrary = true
如果您使用androidX,请在xml中将其用于ImageView:
<androidx.appcompat.widget.AppCompatImageView ... />
设置这样的图像:
app:srcCompat="@drawable/image"
应用程序命名空间在哪里:xmlns:app="http://schemas.android.com/apk/res-auto"