How to divide screen into three parts vertically?

前端 未结 1 1919
慢半拍i
慢半拍i 2021-02-14 18:17

I have screen with ScrollView and three different LinearLayouts.

One LinearLayout contains a Spinner and second conta

相关标签:
1条回答
  • 2021-02-14 18:53

    This is a very simple solution. You should be able to use this in your current layout.

    Just populate the LinearLayouts with your desired contents.

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
    
        <LinearLayout
            android:id="@+id/ll1"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1" >
        </LinearLayout>
    
        <LinearLayout
            android:id="@+id/ll2"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1" >
        </LinearLayout>
    
        <LinearLayout
            android:id="@+id/ll3"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1" >
        </LinearLayout>
    
    </LinearLayout>
    

    Screen shot of the code posted above with colors showing the different layout areas.

    enter image description here

    0 讨论(0)
提交回复
热议问题