Android: how to make a view grow to fill available space?

前端 未结 4 1801
清酒与你
清酒与你 2021-01-30 19:27

This seems straightforward, but I can\'t figure out how to do it. I have a horizontal layout with an EditText and two ImageButtons. I want the ImageButtons to be of a fixed si

4条回答
  •  悲&欢浪女
    2021-01-30 20:10

    Use set the layout_width or layout_height to 0dp (By the orientation you want to fill remaining space). Then use the layout_weight to make it fill remaining space.

提交回复
热议问题