我有FrameLayout的问题.我想创建FrameLayout,它将拥有它的第一个孩子的身高,第二个孩子将获得它的父亲的身高(在本例中为100dp).但我得到的是FrameLayout正在填充屏幕(match_parent).
这是我的xml.
<FrameLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" > <VIEw androID:layout_wIDth="match_parent" androID:layout_height="100dp" /> <VIEw androID:layout_wIDth="match_parent" androID:layout_height="match_parent" /></FrameLayout>
我如何让FrameLayout像它的第一个孩子一样大,第二个孩子和它的父母一样大?我需要使用不同的父母吗?
解决方法:
使用relativeLayout肯定会为您提供您想要实现的目标:
<relativeLayout androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" > <VIEw androID:ID="@+ID/vIEw_ID_1" androID:layout_wIDth="match_parent" androID:layout_height="100dp" /> <VIEw androID:ID="@+ID/vIEw_ID_2" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:layout_alignBottom="@+ID/vIEw_ID_1" androID:layout_aligntop="@+ID/vIEw_ID_1" /> </relativeLayout>
希望这可以帮助!
总结以上是内存溢出为你收集整理的android – FrameLayout wrap_content全部内容,希望文章能够帮你解决android – FrameLayout wrap_content所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)