java - Android fixed header on ListActivity -


i quite new listviews, that's begin with.

anyways, want do, obviousy hold button or whatever on top of list, created programmatically , 1 xml file. xml file:

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/linearlayout1"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="horizontal"     tools:context=".main" >       <imageview         android:id="@+id/picid"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:paddingbottom="10dp"         android:paddingright="10dp"         android:paddingtop="10dp" />      <linearlayout         android:id="@+id/linearlayout2"         android:layout_width="match_parent"         android:layout_height="match_parent"         android:orientation="vertical" >          <textview             android:id="@+id/eventname"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:textsize="18sp" />          <textview             android:id="@+id/eventtime"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_gravity="right"             android:layout_marginright="5dp"             android:textsize="16sp" />     </linearlayout>  </linearlayout> 

then in main.java define listadapter

simpleadapter adapter = new simpleadapter(main.this, fillmaps,                     r.layout.main, from, to);             setlistadapter(adapter); 

so not have <listview/> in xml file.

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:background="#f2b1dbf3"     android:orientation="vertical" > <button  android:layout_alignparenttop="true" android:id="@+id/button" .. > <linearlayout  .. android:layout_below="@+id/button" >...  </relativelayout> 

update

did want this?

enter image description here


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -