Button half width of screen

后端 未结 4 1539
无人共我
无人共我 2020-12-14 14:31

I have a single button in a linear layout. I want the button to take up half the width of its parent. Is there a way to do this in the layout xml.



        
4条回答
  •  自闭症患者
    2020-12-14 15:03

    Yep, the solution is very similar to that question, but you also want to set the weightSum of the parent LinearLayout:

    
    
        

提交回复
热议问题