你必须添加下面一行到您的根布局复制你的形象。
xmlns:app="http://schemas.android.com/apk/res-auto"
请看下面的例子。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/white"
android:clickable="true"
android:orientation="vertical">
<ImageView
app:srcCompat="@drawable/ic_user_red"
android:layout_width="50dp"
android:layout_height="50dp"/>
</LinearLayout>
没有xmlns:app="http://schemas.android.com/apk/res-auto"
不能使用app:srcCompat
。
请告诉你活动代码。 –
它是一个矢量绘制? –
请检查图片的大小。如果它非常大,然后添加一个小尺寸的图像 – Sayem