Android网格布局怎么设置组件占满指定的行和列?

enter code here
<GridLayout xmlns:tools="http://schemas.android.com/tools"

xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"  
android:layout_height="match_parent"   
android:rowCount="6"  
android:columnCount="4" >  

<!-- 定义文本框,跨4列 -->

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_columnSpan="4"
    android:textSize="50sp"
    android:layout_marginLeft="4px"
    android:layout_marginRight="4px"
    android:padding="5px"
    android:layout_gravity="right"
    android:background="#eee"
    android:textColor="#000"
    android:text="测试"
    />
<!-- 定义两个按钮,删除和清零 -->

<Button
    android:id="@+id/bn1"
    android:layout_columnSpan="2" 
    android:layout_rowSpan="1"
    android:layout_gravity="fill"
    android:text="清零"
     /> 
    <Button
    android:id="@+id/bn2"
    android:layout_columnSpan="2" 
    android:layout_rowSpan="1"
    android:layout_gravity="fill"     
    android:text="删除"
    />

以上为mail.xml中的代码,运行结果如下图CSDN移动问答
想让清零和删除按钮在那一行分别占一半,但是怎么设置都不成功。求指点

你只是想要这两个底部按钮的宽度一样吧。使用 layout_width=fill_parent 横向的把它们放在一个 LinearLayout 中。给每一个按钮设置相同的 layout_weight,每一个按钮的宽度为 0dp。这样的话它们的宽度就相同了。