<ImageView
android:id="@+id/handle"
android:layout_width="48dp"
android:layout_height="48dp"
android:src="@drawable-mdpi/ic_launcher.png"
android:contentDescription="what"
android:id="@+id/handle"
android:layout_width="48dp"
android:layout_height="48dp"
android:src="@drawable-mdpi/ic_launcher.png"
android:contentDescription="what"
/>
修改为
android:src="@drawable/ic_launcher"即可
本文介绍了一个关于Android开发中ImageView资源路径配置的小技巧。通过将图片资源路径从'drawable-mdpi'更改为'drawable',可以使得ImageView正确加载图标资源,避免因资源路径不匹配导致的问题。

1058

被折叠的 条评论
为什么被折叠?



