我想補充一點,是不是在ImageButton的在XML資源文件中找到一些額外的數據,並能夠通過代碼附加額外數據的ImageButton android系統
就這樣
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
app:angle="0"
app:titletext="imageButton1"/>
讀它
我在哪裏可以定義這些數據是accessable和XML不會導致錯誤提前
每個按鈕會改變的TextView的文本,我有許多按鈕,所以我想定義一個額外的禮讓,並將其附加到按鈕,以便能夠通過代碼 – 2012-02-12 22:00:24
erm每個按鈕已經有這個... androi d:id =「@ + id/imageButton1」,所以id是:「imageButton1」?你可以在代碼中訪問它ImageButton myButton =(ImageButton)findViewById(R.id.imageButton1); – 2012-02-12 22:20:37