什么是机器人:layout_weight是什么意思?机器人、layout_weight

2023-09-11 10:26:22 作者:心中不平衡゛

我不知道如何使用这个属性。谁能告诉我更多一点吗?

I don't understand how to use this attribute. Can anyone tell me more about it?

推荐答案

通过 layout_weight 您可以指定多个视图之间的大小比例。例如。你有一个图形页面表格这应该表现出一些额外的信息到地图中。地图应使用屏幕的3/4,并表应使用屏幕的1/4。然后你会设置的 layout_weight 地图 3和 layout_weight 1。

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.

要得到它的工作,你还必须设置高度或宽度(取决于你的方位)为0px。

To get it work you also have to set the height or width (depending on your orientation) to 0px.