错误:未找到与给定名称匹配的资源(在“src”处,值为“@drawable-hdpi/ic_launcher”)。为什么会出现此错误?
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable-hdpi/ic_launcher" />
</RelativeLayout>
最佳答案
您不必指定特定的文件夹。系统会根据应用程序运行的屏幕密度加载正确的内容
android:src="@drawable-hdpi/ic_launcher"
应该是
android:src="@drawable/ic_launcher"
关于android - 给我看 android :src error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27312704/