开发者

merge table in android

I want to have table layout like this

|text  | edittext                 | text

|text  | radiobutton  radiobutton | text

you can see that in column two row two I want to

have 2 radiobutton and I want to have coloumn开发者_开发百科 width like the upper line

what should I do?


The closest thing I've got:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" 
android:orientation="horizontal">
<LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical"
    android:layout_weight="1" android:gravity="center_vertical">
    <TextView android:text="TextView" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5dip" android:layout_marginBottom="10dip"></TextView>
    <TextView android:layout_width="wrap_content" android:id="@+id/textView2" android:layout_height="wrap_content" android:text="TextView" android:gravity="bottom" android:layout_marginLeft="5dip"></TextView>
</LinearLayout>
<LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical"
    android:layout_weight="1">
    <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="EditText" android:id="@+id/editText1"></EditText>
    <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/linearLayout1" android:orientation="horizontal">
        <RadioButton android:layout_weight="1" android:text="" android:id="@+id/radioButton1" android:layout_width="wrap_content" android:layout_height="wrap_content"></RadioButton>
        <RadioButton android:layout_weight="1" android:text="" android:id="@+id/radioButton2" android:layout_width="wrap_content" android:layout_height="wrap_content"></RadioButton>
    </LinearLayout>
</LinearLayout>
<LinearLayout 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
    android:orientation="vertical"
    android:layout_weight="1" android:gravity="center_vertical">
    <TextView android:layout_width="wrap_content" android:id="@+id/textView3" android:layout_height="wrap_content" android:text="TextView" android:layout_marginBottom="10dip" android:layout_marginLeft="5dip"></TextView>
    <TextView  android:text="TextView" android:id="@+id/textView4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5dip"></TextView>
</LinearLayout>

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜