在android布局中layout_height =“0dip"的效果/含义是什么? [英] In android layouts what is the effect/meaning of layout_height="0dip"

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

问题描述

我见过几个使用android: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 并让权重控制实际值.虽然我很确定 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 =“0dip"的效果/含义是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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