1、設置按鈕固定寬度,但不建議
2、設置按鈕寬度為wrap_content,並設置layout_weight等分剩下的空間。
如:
android:layout_width="wrap_content"
android:layout_weight="1"/>
android:layout_width="wrap_content"
android:layout_weight="1"/> //所以同壹行的按鈕的layout_weight都設置同壹個數值,起到等分剩下空間的作用。這樣按鈕就壹樣大了。
android:layout_width="wrap_content"
android:layout_weight="1"/>