0
我目前的Android布局设计看起来是这样的(伪)如何在android布局的屏幕底部选择覆盖层的wrap_content高度?
<RelativeLayout width&height=match_parent>
<RelativeLayout width&height=match_parent>
<!-- App content here -->
</RelativeLayout>
<RelativeLayout width=match_parent height=wrap_content>
<!-- These views should overlay the bottom of the screen -->
<Textview />
<Button />
</RelativeLayout>
</RelativeLayout>
的问题是,覆盖部分的高度应以显示所有文本所需的高度。该按钮应该复制TextView的高度。
我把这样的:
button height: match_parent
textview height: wrap_content
但:按钮的match_parent似乎走的空间全屏,因为它的父包的内容(Like this!)。
如果我把TextView和Button的高度作为wrap_content:我有另一个问题。该按钮的高度小于TextView的高度。
有没有人有任何想法我可以解决这个问题?
这是解决方案!它工作得很好,非常感谢!我没有意识到alignTop&alignBottom属性。只需指出:Button的高度应该是wrap_content,并且TextView的高度应该是wrap_content与此方法。 –