开发者

how to add 2 buttons horizontally with 50% width for each in android?

开发者 https://www.devze.com 2023-01-26 11:51 出处:网络
how to add 2 buttons horizontally with 5开发者_开发问答0% width for each ? Put them in a LinearLayout

how to add 2 buttons horizontally with 5开发者_开发问答0% width for each ?


  1. Put them in a LinearLayout
  2. Give them each android:layout_width="0px"
  3. Give them each android:layout_weight="1"


Add both the buttons in linearlayout and give orientation as horizontal.And give width as zero dp for both buttons and layout_weight=1 for each.It will work.

0

精彩评论

暂无评论...
验证码 换一张
取 消