android: relative layout two buttons occupy all the available horizontal space

前端 未结 6 1208
不知归路
不知归路 2021-02-13 11:06

i have a relative layout and i have two buttons in it with texts \"hello\" and \"world\" respectively. i want these two buttons to lie adjacent to each other and equally occupy

6条回答
  •  我寻月下人不归
    2021-02-13 11:48

    Take a Button align it in center with 1dp width and height. Now place your Button1 with the property android:layout_width = fill parent to left of center, again with respect to center button put Button2 to the right of center with the property android:layout_width = fill parent.

提交回复
热议问题