我终于让我的图像按钮在 ImageView 中工作,在我按下它之后,它就可以工作了,但是之后它立即停止运行并且我收到错误消息来关闭它。我添加了 onClick 并将其集中在 XML 中,以便它可以在图像视图中工作,但这就是我所得到的。/drawable文件夹中的按钮是imagebutton选择器代码:http: //developer.android.com/reference/android/widget/ImageButton.html
<ImageView
android:onClick="true"
android:src="@drawable/button"
android:focusable="true"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:scaleType="fitStart"
我怀疑我忘记了什么......