how to add 2 buttons horizontally with 50% width for each in android?
how to add 2 buttons horizontally with 5开发者_开发问答0% width for each ?
- Put them in a
LinearLayout
- Give them each
android:layout_width="0px"
- 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.
精彩评论