首先说明下,我是个纠结的人
虽然可以用tablelayout来做,但我还是想用gridlayout来实现下图
因为要设置每个单元格的背景,所以我想应该需要嵌套LinearLayout
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:columnCount="2"
android:orientation="horizontal"
android:rowCount="3" >
<LinearLayout
android:id="@+id/linear01"
android:layout_column="0"
android:layout_row="0"
android:background="@drawable/blockbg_big"
android:orientation="horizontal" >
....这里加textview
</LinearLayout>
<LinearLayout
android:id="@+id/linear02"
android:layout_column="1"
android:layout_row="0"
android:background="@drawable/blockbg_big"
android:orientation="horizontal" >
</LinearLayout>
</GridLayout>
但设置了背景图片后,这一个单元格就占满一行了,这一行其他内容就无法显示了,
能教教我如果要做个图,要用gridlayout怎么做吗?
我知道gridlayout的优点是跨越行或列,但感觉这个例子不好做