2012-05-22 59 views
0

我需要Java代碼中的TableLayout和ImageButton,但有一個問題,所以我想在xml中這樣做,但我不理解爲什麼第一個按鈕是這樣操作的。TableLayout中的Android ImageButton

<TableLayout 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
xmlns:android="http://schemas.android.com/apk/res/android"> 
<TableRow> 
    <ImageButton 
     android:src="@drawable/blankc4" 
     /> 
    <ImageButton 
     android:background="@android:color/white" 
     android:src="@drawable/blankc4" 
     /> 
</TableRow> 
<TableRow> 
    <ImageButton 
     android:background="@android:color/white" 
     android:src="@drawable/blankc4" 
     /> 
    <ImageButton 
     android:background="@android:color/white" 
     android:src="@drawable/blankc4" 
     android:layout_column="2" 
     /> 
</TableRow> 
</TableLayout> 

輸出

enter image description here

有什麼我失蹤。如果不是這個輸出的解釋是什麼。

我只想要和沒有背景色一樣的按鈕。如何做到這一點。

回答

0

你有一個backgound每個人,除了首盤...

如果你正在尋找的只是圖像的按鈕,不使用的源代碼,但背景設置爲圖像你要。

+0

我必須在運行時更改背景顏色。 – Sudeepta