I want to set the header of a listview as a static non-clickable
element to be used as a column heading row at the top of the list.
This allows me to reuse the following xml linearlayout created for
list rows as the header, automatically maintaining consistency between
column headings and row elements (the android:text property is simply
left as is for the header)

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
        android:orientation="horizontal"
        android:paddingTop="5sp"
        android:paddingBottom="5sp"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >
        <TextView android:id="@+id/ingredient"
                android:text="Ingredient"
                android:layout_weight="1"
                android:layout_width="wrap_content"
                android:layout_height="fill_parent" />
        <TextView android:id="@+id/quantity"
                android:text="Qty"
                android:paddingRight="10sp"
                android:layout_width="wrap_content"
                android:layout_height="fill_parent" />
        <TextView android:id="@+id/unit"
                android:text="Unit"
                android:width="80sp"
                android:paddingRight="10sp"
                android:textAlign="end"
                android:layout_width="wrap_content"
                android:layout_height="fill_parent" />
</LinearLayout>



I have tried this:
...
View headerView =
getViewInflate().inflate(R.layout.inventorylist_row,null,false,null);
headerView.setClickable(false);
headerView.setFocusable(false);
headerView.setFocusableInTouchMode(false);
getListView().addHeaderView(headerView,null,false);
setListAdapter(adapter);
...

But in touch mode the header row still responds to clicks and when
using the d-pad, if I push "up" when I first start this activity, the
header is selected and can then be clicked.

Is this a bug, or can someone tell me of some other property that I
need to set ?

Ben
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to