开发者

Android how to get components inside a layout to take up an equal percentage of space

For examples two buttons inside a linear layout or a relative layout. Have each b开发者_如何学JAVAutton always take up 50% of space in parent container. How is this specified? Thanks


<LinearLayout>
<Button
    layout_weight="0.5"
/>
<Button
    layout_weight="0.5"
/>
</LinearLayout>

each button will take 50% of the linearLayout.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜