I used a row.xml and header.xml to make my listview as the follow, there is a SimpleAdapter to collect the items that I want to display on my list. My question is, how to make the header fixed and not scroll with the list items?
ListView lv;
SimpleAdapter sd;
lv = getListView();
lv.addHeaderView(getLayoutInflater().inflate(
R.layout.header, null, false));
sd = new SimpleAdapter(this, aList, R.layout.row,
new String[]
{ "date", "date2", "date3",
"date4" }, new int[]
{ R.id.date, R.id.date2, R.id.date3,
R.id.date4});
lv.setAdapter(sd);
In order to not to make your list’s header scrollable, you must put the header above of your ListView in xml. Because whatever inserted as item inside ListView is meant to scroll in a regular fashion. So if you put the header outside and above the ListView, it will be perceived as a static header and will not scroll.