我有這樣的佈局:如何在LinearLayout中水平對齊3個固定寬度按鈕?
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="32dp">
<Button
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Button1"/>
<Button
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Button2"/>
<Button
android:layout_width="100dp"
android:layout_height="wrap_content"
android:text="Button3"/>
</LinearLayout>
欲水平對齊這些3 修復寬度按鈕。請問你能幫幫我嗎 ?
您有什麼問題試試這個,變化的重量? – Amsheer
你可以給每個按鈕分配android:layout_weight =「1」 – Moinkhan