android:layout_weight 是什么意思? [英] What does android:layout_weight mean?
问题描述
我不明白如何使用这个属性.谁能告诉我更多有关它的信息?
使用 layout_weight
您可以指定多个视图之间的大小比例.例如.您有一个 MapView
和一个 table
,它们应该向地图显示一些附加信息.地图应使用屏幕的 3/4,表格应使用屏幕的 1/4.然后设置map
的layout_weight
为3,table
的layout_weight
为1.>
要使其正常工作,您还必须将高度或宽度(取决于您的方向)设置为 0px.
I don't understand how to use this attribute. Can anyone tell me more about it?
With layout_weight
you can specify a size ratio between multiple views. E.g. you have a MapView
and a table
which should show some additional information to the map. The map should use 3/4 of the screen and table should use 1/4 of the screen. Then you will set the layout_weight
of the map
to 3 and the layout_weight
of the table
to 1.
To get it work you also have to set the height or width (depending on your orientation) to 0px.
这篇关于android:layout_weight 是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!