在Android的布局是什么layout_height =&QUOT的影​​响/含义; 0dip"布局、含义、Android、layout_height

2023-09-12 09:01:08 作者:灬众里寻他千百度

我见过的几个实例 机器人:layout_height =0px​​或0dip但我不明白,这方面的影响。看来,将使布局0像素高。就降低了值,但像重或任何父视图的高度一些其他的因素?

I've seen several examples that use android:layout_height="0px" or "0dip" but i do not understand the impact of this. It seems that would make the layout 0 pixels tall. Is the value mitigated but some other factor like 'weight' or the height of any parent views?

推荐答案

是的,你是对的重量,当你想要的宽度或高度重量被控制其约定该值设置为0dip并让控制体重的实际值。虽然我是pretty的肯定0只是随意在这里,你可以把任何东西,但把0使得你的意图更加清晰。

Yep you are right about the weight, when you want the width or height to be controlled by weight its convention to set that value to 0dip and let the weight control the actual value. Although I am pretty sure 0 is just arbitrary here you could put anything but putting 0 makes your intention more clear.