我想要有一个Tablelayout以下属性,android tableLayout列色问题
1.我想改变列的背景颜色。现在,如果我为TextView设置背景,它将封装内容并将该颜色设置为不是整列。我想为我的两列添加不同的颜色。
2.更改两列之间的空间(可能是边框)。
有人做过这样的事情请帮帮我。由于
<TableLayout
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dip"
android:layout_margin="2dip"
android:orientation="vertical" >
<TableRow
android:padding="3dip"
android:id="@+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dip">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="@string/NameLabel"
android:textColor="@color/black"
android:textSize="20sp"
android:background="#1DA43F"/>
<TextView
android:layout_marginLeft="5dip"
android:id="@+id/NameText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAlignment="center"
android:layout_gravity="left"
android:text="@string/NameLabel"
android:background="@color/DarkRed"
android:textSize="20sp"/>
</TableRow></TableLayout>
向我们展示你当前的代码。 –
已更新代码... –
当您说'我应该能够更改'时,您是指动态还是XML? –