Valentino Ru
Valentino Ru

Reputation: 5052

Equivalent to layout_weight for height

Is there any equivalent command to the mentioned Iayout-weight to dynamically define the height of more than one View inside a LinearLayout? I want to have a LinearLayout with orientation="vertical" and then split that height to a defined ratio, but I can't find any command for that.

Upvotes: 3

Views: 5321

Answers (2)

Ram kiran Pachigolla
Ram kiran Pachigolla

Reputation: 21191

whenever you use layout-weight. if you give width as 0dp then it weight is applicable for width. like that for height also

Upvotes: 4

cjk
cjk

Reputation: 46465

You don't need an equivalent to layout-weight, you just use that. Set your width to a value you want, set height to be 0dp and set the weight to be in proportion to what you want.

Upvotes: 8

Related Questions