Android4.0布局Gridlayout的问题

pangziwenwen 2015-03-20 01:39:57
首先说明下,我是个纠结的人
虽然可以用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的优点是跨越行或列,但感觉这个例子不好做
...全文
57 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

80,360

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧