第一步:在Main_xml文件中布局设计代码:
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:rowCount="6" android:columnCount="4" android:id="@+id/root" > <TextView android:text="0" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_columnSpan="4"