我有一个 GridLayout,布局中会有两个或多个按钮,并且所有按钮必须具有相同的宽度。我的问题是,当按钮的文本行数不同时,按钮的 marginTop 也会不同。我怎样才能解决这个问题?谢谢。
<GridLayout
android:id="@+id/grid_buddies"
android:columnCount="4"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="60dp"
android:layout_height="match_parent"
android:text="TEST"/>
<Button
android:layout_width="60dp"
android:layout_height="wrap_content"
android:text="TESTDDFF"/>
</GridLayout>
这是图片: