在Android的布局是什么layout_height =&QUOT的影​​响/含义; 0dip" [英] In android layouts what is the effect/meaning of layout_height="0dip"

查看:100
本文介绍了在Android的布局是什么layout_height =&QUOT的影​​响/含义; 0dip"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过的几个实例 机器人: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.

这篇关于在Android的布局是什么layout_height =&QUOT的影​​响/含义; 0dip"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆