Place 3 buttons in a LinearLayout to occupy equal amount of space

前端 未结 9 1619
滥情空心
滥情空心 2021-01-31 14:50

i would like to have three buttons taking equal amount of available space horizontally in a row. I used android:layout_gravity. What is the problem?

layout

9条回答
  •  北荒
    北荒 (楼主)
    2021-01-31 15:20

    Divide the weight sum to equal proportion in all buttons.

    Remove layout_gravity property and add android:layout_weight=0.33.

    It will work

提交回复
热议问题