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

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 3.55 KB  |  hits: 12  |  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. listview with header and footer
  2. <?xml version="1.0" encoding="utf-8"?>  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.     android:layout_width="fill_parent"
  4.     android:layout_height="fill_parent"
  5.     android:orientation="vertical"
  6.     android:background="#ffffff">
  7.  
  8. <!--  Header Starts-->
  9. <LinearLayout android:id="@+id/header"
  10.         android:layout_width="fill_parent"
  11.         android:layout_height="wrap_content"
  12.         android:background="@layout/header_gradient"
  13.         android:layout_margin="5dip"
  14.         android:paddingTop="13dip"
  15.         android:paddingBottom="8dip">
  16.     <!-- Logo Start-->
  17.     <ImageView android:src="@drawable/logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip" />
  18.     <!-- Logo Ends -->
  19. </LinearLayout>
  20. <!--  Header Ends -->
  21.  
  22. <!-- Content -->
  23.     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  24.               android:layout_height="fill_parent"
  25.               android:layout_width="fill_parent"
  26.               android:orientation="vertical"
  27.               android:gravity="center">
  28.  
  29.         <LinearLayout android:orientation="horizontal"
  30.                 android:layout_width="fill_parent"
  31.                 android:layout_height="wrap_content"
  32.                 android:layout_margin="5dip">
  33.  
  34.             <EditText android:id="@+id/searchText"
  35.                     android:layout_width="fill_parent"
  36.                     android:layout_height="fill_parent"
  37.                     android:layout_weight="1"/>
  38.  
  39.             <ImageButton android:id="@+id/searchButton"
  40.                     android:layout_height="wrap_content"
  41.                     android:layout_width="wrap_content"
  42.                     android:src="@android:drawable/ic_menu_search" />
  43.         </LinearLayout>
  44.  
  45.         <ListView android:id="@+id/lstNews"
  46.                 android:layout_height="fill_parent"
  47.                 android:layout_width="fill_parent"
  48.                 android:layout_marginLeft="5dip"
  49.                 android:layout_marginRight="5dip" />
  50.     </LinearLayout>
  51.  
  52. <!-- Footer Start -->
  53. <LinearLayout android:id="@+id/footer"
  54.      android:layout_width="fill_parent"
  55.      android:layout_height="30dip"
  56.      android:background="@layout/footer_gradient"
  57.      android:layout_margin="5dip"
  58.      android:paddingTop="5dip"
  59.      android:paddingLeft="5dip"
  60.      android:layout_alignParentBottom="true">
  61.     <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#FFFFFF" android:text="Instituto Superior de " />
  62.     <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#FFFFFF" android:textStyle="bold" android:text="Engenharia" />
  63.     <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#FFFFFF" android:text=" do Porto" />
  64. </LinearLayout>
  65. <!-- Footer Ends --></LinearLayout>
  66.        
  67. <!--  Header Starts-->
  68. <LinearLayout android:id="@+id/header"
  69.     android:layout_width="fill_parent"
  70.     android:layout_height="wrap_content"
  71.     android:background="@layout/header_gradient"
  72.     android:layout_margin="5dip"
  73.     android:paddingTop="13dip"
  74.     android:paddingBottom="8dip"
  75.     android:layout_above="@id/content">
  76.        
  77. <!-- Content -->
  78. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  79.           android:id="@+id/content"
  80.           android:layout_height="fill_parent"
  81.           android:layout_width="fill_parent"
  82.           android:orientation="vertical"
  83.           android:gravity="center"
  84.           android:layout_above="@id/footer">