Farid Ala
Farid Ala

Reputation: 668

Custom listview in Android with an image at top

I have an Android project that displays results, using a simple listview. What I need is to display an image at the top of listview as follows:

Before scrolling

After scrolling

Please note, the image on top, should be scrollable. Would you please help me. Thanks.

Upvotes: 2

Views: 1556

Answers (2)

MSD
MSD

Reputation: 2647

List view has header and footer options. You can put your scrollable image view in one XML layout, inflate and use that as list view header.

You can get more info if you search for list view header. The quickest one I can get is

Android listview with header and footer buttons

Upvotes: 2

AdamK
AdamK

Reputation: 21399

Use ListView.addHeaderView() to add a header view to the top of your ListView.

Upvotes: 6

Related Questions