Skip to content Skip to sidebar Skip to footer

Attaching A Fixed, Transparent, Header To A Listview?

I've been trying to get this working for some time... Is there any way to put a transparent fixed header on a listview, so it looks kind of like this: As you scroll up, the header

Solution 1:

I would make a FrameLayout... and put your ListView in it first, filling the screen. Then put a TextView on top of that. To get the desired behavior at the top, maybe have a blank element at position 0 of the list, or just make the top padding of list item 0 have the height of your header...

Does that make sense? The ListView should scroll underneath the TextView in a FrameLayout.

Solution 2:

You can use a RelativeLayout for that, so you can get the Z axis using some properties;)

Update:

For example using a RelativeLayout:

RelativeLayout ----ListView ----TransparentHeader

Will appear in the way you show on your image.

As a comment :Android put layout elements in the order that they are defined on your xml, so, widgets at the bottom of the layout will be at the top.

Post a Comment for "Attaching A Fixed, Transparent, Header To A Listview?"