我有一個GridLayout,並且佈局中會有兩個或更多按鈕,並且所有按鈕都必須具有相同的寬度。 我的問題是,當按鈕具有不同的文本行號時,按鈕的marginTop也會不同。 我該如何解決這個問題? 謝謝。Gridlayout中的Android按鈕沒有相同的邊距頂部
<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>
這裏是圖片:
您可以更改按鈕上的文字大小,使其能夠適應。 –