2011-08-26 78 views
0

我想在视图下方设计以在Android平板电脑上显示它。我想知道xml代码来设计这种视图。谁能帮我 ?使用Android选项卡的表格布局设计视图?

enter image description here

我现在用下面的代码... 但如何设置50%tablelayout在两侧

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:gravity="left" android:layout_height="fill_parent" android:id="@+id/relativeLayout1"> 
    <TableLayout android:layout_toLeftOf="@+id/tableLayout2" android:id="@+id/tableLayout1" android:layout_width="wrap_content" android:layout_height="fill_parent"> 

    <TextView android:text="table 1"></TextView> 


    </TableLayout> 

    <TableLayout android:layout_toRightOf="@+id/tableLayout1" android:id="@+id/tableLayout2" android:layout_width="wrap_content" android:layout_height="fill_parent"> 


    <TextView android:text="table 2"></TextView> 



    </TableLayout> 

    </RelativeLayout> 

回答

2

内TableLayout使用的TableRow,并使用内部的TableRow其他意见。

+0

是的,我会添加它。但如何使两个Tablelayout 50%的宽度。 – Mak

+0

对于TableRow中的每个视图给android:layout_weight =“1”,我试过这个工作。 – Aju

+0

它为我的兄弟工作。 – Aju

0

我会在另一个线性布局内使用2个线性布局。 子布局将使用layout_weight = 1.

+0

我想显示两个列表视图所以我使用表布局,并希望显示两个表格布局的等宽.. – Mak

相关问题