繁体   English   中英

如何将LinearLayout放在LinearLayout下面的另一个RelativeLayout中?

[英]How to place a LinearLayout below a LinearLayout inside another RelativeLayout?

我试图将LinearLayout放在另一个RelativeLayout内的LinearLayout下面?

<ScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true" >
<RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="top"
                >

            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/background_linearlayout_reportdelay"

                 >
           </LinearLayout>

    </RelativeLayout>
    </ScrollView>

有什么方法可以做到吗?

谢谢

<RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <LinearLayout
                android:id="@+id/layout1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="top">

            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/background_linearlayout_reportdelay"
                android:layout_below="@+id/layout1">
           </LinearLayout>

    </RelativeLayout>

试试这种方式,希望这可以帮助您解决问题。

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/background_linearlayout_reportdelay" />

        </LinearLayout>
</ScrollView>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM