我有一个关于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与其第一个子项一样大,而第二个子项与其父容器一样大?我需要使用不同的父容器吗?