【发布时间】:2010-08-29 15:43:45
【问题描述】:
我终于让我的图像按钮在 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"
我怀疑我忘记了什么......
【问题讨论】:
-
xml 只是布局。代码(java代码)是什么样的?
标签: android eclipse onclick imageview imagebutton