我在另一个布局中设置了一个 RelativeLayout,我希望内部布局与外部布局具有相同的宽度。
我有什么:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:visibility="visible"
tools:context=".MainActivity" >
<RelativeLayout
android:id="@+id/fragment_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/lady"
android:visibility="visible" >
</RelativeLayout>
</RelativeLayout>
我需要什么:
最佳答案
使内部 RelativeLayout
宽度为 match_parent
而不是 wrap_content
。
关于android - 如何在另一个内部拉伸(stretch)一个相对布局?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23985486/