android - 3 layouts - middle is flexible -


i need following thing:

3 layouts:

  1. header
  2. content
  3. footer

header must on top footer must sticked bottom (android:layout_alignparentbottom="true").

but how make middle occupy whole other screen? thanks.

here solution (with android:layout_weight , scrollview):

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" >  <linearlayout     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:layout_weight="1"     android:background="#dddddd"     android:gravity="center"     android:orientation="vertical" >      <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="header"         tools:ignore="hardcodedtext" /> </linearlayout>  <scrollview     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:layout_weight="3" >      <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_gravity="center"         android:text="content"         tools:ignore="hardcodedtext" />  </scrollview>  <linearlayout     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:layout_weight="1"     android:background="#dddddd"     android:gravity="center"     android:orientation="vertical" >      <textview         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="footer"         tools:ignore="hardcodedtext" />  </linearlayout></linearlayout> 

and result picture :

enter image description here


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -