简体   繁体   中英

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:

滚动前

滚动后

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM