Amal Amal - 5 months ago 27
Android Question

How to place a LinearLayout below a LinearLayout inside another RelativeLayout?

Im trying to place à LinearLayout below a LinearLayout inside another RelativeLayout?

<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>


Is there any way I can do that?

Thank you

Answer

Try this way,hope this will help you to solve your problem.

<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>

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

        </LinearLayout>
</ScrollView>
Comments