Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 14th, 2012  |  syntax: None  |  size: 1.65 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. linearlayout centered vertically between two linearlayout
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.     android:layout_width="match_parent"
  4.     android:layout_height="match_parent"
  5.     android:orientation="vertical" >
  6.  
  7.  
  8.     <LinearLayout
  9.         android:layout_width="match_parent"
  10.         android:layout_height="wrap_content" >
  11.  
  12.     </LinearLayout>
  13.  
  14.     <LinearLayout
  15.         android:layout_width="match_parent"
  16.         android:layout_height="wrap_content"
  17.         android:layout_weight="1">
  18.  
  19.     </LinearLayout>
  20.  
  21.     <LinearLayout
  22.         android:layout_width="match_parent"
  23.         android:layout_height="wrap_content" >
  24.  
  25.     </LinearLayout>
  26.  
  27. </LinearLayout>
  28.        
  29. <?xml version="1.0" encoding="utf-8"?>
  30. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  31.     android:layout_width="fill_parent"
  32.     android:layout_height="fill_parent" >
  33.  
  34.     <LinearLayout
  35.         android:id="@+id/ui_main_header"
  36.         android:layout_width="fill_parent"
  37.         android:layout_height="wrap_content"
  38.         android:layout_alignParentTop="true"
  39.         android:orientation="horizontal"/>
  40.  
  41.  
  42.     <LinearLayout
  43.         android:id="@+id/ui_main_footer"
  44.         android:layout_width="fill_parent"
  45.         android:layout_height="wrap_content"
  46.         android:layout_alignParentBottom="true"
  47.         android:orientation="horizontal"/>
  48.  
  49.     <LinearLayout
  50.         android:id="@+id/ui_main_center"
  51.         android:layout_width="fill_parent"
  52.         android:layout_height="fill_parent"
  53.  
  54.         android:layout_below="@id/ui_main_header"
  55.         android:layout_above="@id/ui_main_footer"
  56.  
  57.         android:orientation="vertical"/>
  58.  
  59. </RelativeLayout>