它是一個愚蠢的問題。做好準備。Android - 另一個按鈕問題
我main.xml中是這樣的:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/white">
<ImageButton
android:src="@drawable/button"
android:scaleType="fitStart"
android:layout_height="fill_parent"
android:layout_width="wrap_content"
/>
</RelativeLayout>
它的工作原理。不過,我實際上看到一個安卓按鈕,裏面有我的圖片。當你點擊它時,外面會變成橙色和一切。我如何得到它,以便外部按鈕不會出現?
請幫忙嗎?
謝謝,但一個ImageView不會工作...它只顯示第一個drawable。這是爲什麼? – Mia 2010-08-22 18:37:57
您是否在點擊偵聽器中指定了視圖?直到這樣才能點擊。另外不要忘記讓它可以聚焦。 – 2010-08-22 18:42:07
http://developer.android.com/intl/zh-TW/guide/topics/ui/ui-events.html http://tseng-blog.nge-web.net/blog/2009/02/14/implementation-listeners-in-your-android-java-application/ 你可以在那裏找到例子。 – 2010-08-22 21:01:06