On 06/12/2010 04:38 PM, Bill Lumberg wrote:
> I have a ListView with several columns and I need a header row at the
> very top that labels each of these columns that *does not* scroll with
> the rest of the ListView. I am using addHeaderView right now, but I've
> ran into 2 problems:
> 
> 1) The header scrolls. I need it outside of scrolling so that it's
> always "floating" on top.

Put the header outside the ListView.

> 2) Each column in the header isn't lining up with the columns in the
> listview. I can make the header columns and data columns all line up
> perfectly if they're all in one big TableLayout, but how would I get
> the header to be outside of the scrollview yet also stay uniform and
> inline with the data columns?

You'll need to set the sizes of every one of your columns -- in other
words, use dimension resources instead of wrap_content for the width. If
you use a RelativeLayout for the header and a RelativeLayout for the
rows, you can then use those same dimensions and layout_marginLeft to
have everything consistently line up.

Or, use GridView.

Or, write a MultiColumnListView.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 2.1 Available!

-- 
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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to