我想在我的tablelayout视图中设置背景颜色,但我不能,因为它没有绘制整个屏幕。我的目标是在屏幕的中心(水平和垂直)和背景蓝色有2个圆形按钮。 我现在所拥有的是这样的:Android:TableLayout中的背景颜色
背景颜色不填充所有屏幕。
,我有以下代码:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#8ad5f0"
tools:context="com.converter.android.dailyhoroscope.SignActivity">
<Button
android:text="Extensive"
android:background="@drawable/default_button_selector"
android:layout_width="102dp"
android:layout_height="97dp"
android:gravity="center"
android:textStyle="bold"
android:onClick="onClick"
android:layout_marginBottom="4dip"
android:id="@+id/extensive"
android:textColor="#079dd0"
android:textSize="12dp"/>
如果我改变了以下2行match_parent:
android:layout_width="match_parent"
android:layout_height="match_parent"
我得到这个:
你有什么想法我该如何解决这个问题?
不工作:\ – porthfind 2015-02-06 13:37:15