桌面布局中未显示重力的Android单选按钮
我有这样的布局:桌面布局中未显示重力的Android单选按钮,android,tablelayout,Android,Tablelayout,我有这样的布局: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TableLayout android:layout_width="wrap_con
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableLayout android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="*" android:background="#00ff00">
<TableRow android:layout_margin="1dip">
<TextView android:text="col 1" android:background="#0000ff" android:layout_margin="1dip"/>
<TextView android:text="col 2" android:background="#0000ff" android:layout_margin="1dip"/>
<TextView android:text="col 3" android:background="#0000ff" android:layout_margin="1dip"/>
<TextView android:text="col 4 with more text" android:background="#0000ff" android:layout_margin="1dip"/>
</TableRow>
<TableRow android:layout_margin="1dip" >
<TextView android:layout_height="fill_parent" android:text="text" android:background="#0000ff" android:layout_margin="1dip"/>
<TextView android:layout_height="fill_parent" android:text="text" android:background="#0000ff" android:layout_margin="1dip"/>
<RadioButton android:background="#0000ff" android:id="@+id/radioButton1" android:layout_gravity="center" ></RadioButton>
<RadioButton android:id="@+id/radioButton2" android:layout_gravity="center" >
</RadioButton>
</TableRow>
</TableLayout>
</ScrollView>
ID为radioButton1的radiobutton不显示。
如果我删除它的背景色,它就会显示出来。
如果我保留背景色并移除它显示的布局
有人知道我做错了什么吗?
RadioButton
的背景默认是一个9patch,它在标签旁边为单选按钮图像留出了空间,所以这可能会把一切都搞糟。如果您想设置背景色,我认为您必须修改原始的9patch图像(请参阅)