2012-05-22 41 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