<ImageView
android:id="@+id/fontList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:onClick="onclick"
android:src="@drawable/font" />比如把写好的一个imageview 在放到别处,就会报错(类型转换错误???)
后来起了不同的+id名字,就好了。

本文介绍了一种常见的Android开发中ImageView使用错误导致的类型转换异常,并分享了解决方案:通过为ImageView分配唯一的ID来避免此类问题的发生。
4172

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



