<span style="font-size:18px;"><?xml version="1.0" encoding="utf-8"?> <!-- android:columnCount="2"设置列数 android:rowCount="2" 设置行数 --> <GridLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:columnCount="3" android:rowCount="3" > <!-- android:layout_row="0" 设置第0行 android:layout_column第0列 --> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_column="0" android:layout_row="0" android:text="你好" /> <!-- android:layout_columnSpan="2"合并两列 需要 android:layout_gravity="fill_horizontal" --> <!-- 不然看不出效果 *****layout_rowSpan不用写***** --> <!-- 如果有元素列写了的位置 另一个元素合并了(rowspan占了它)那么两个元素重叠显示 --> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_column="1" android:layout_columnSpan="2" android:layout_gravity="fill_horizontal" android:layout_row="0" android:layout_rowSpan="2" android:text="嘿嘿" /> </GridLayout></span>
02网格布局Gridlayout
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
【Android 布局】GridLayout(网格布局)
文章目录GridLayout(网格布局)本节引言1.相关属性总结图2.使用实例:计
android 布局 返回顶部 网格布局 -
Java开发GUI之GridLayout网格布局
GridLayout布局应用。
Java JavaGUI Java界面 GridLayout 网格布局