Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ViewPager with header view [closed]

I need to make layout that looks like this
enter image description here
There is header view (RelativeLayout), below is ViewPager Indicator and then ViewPager with pages (FragmentPagerAdapter) which contains ListView or ScrollView. Because header view can be big, whole layout should be scrollable.

My best try is to have ListView with two headers (Header view and ViewPager) - but this is very bad because of ListView inside another ListView and recycling problems.

What is the best approach to do that? Is there any method to add ViewPager header view as it can be done with ListView and addHeaderView() method?

Thank you for help!

like image 554
Warlock Avatar asked Jan 03 '14 15:01

Warlock


1 Answers

You can also achieve this effect by using the Android-ParallaxHeaderViewPager a good example of scrolling tab header by kmshack Github page

The Sample code is give in this Here Git Hub link

enter image description here

The explanation for the solution is begin described in the github page

Hope this will help you

like image 59
Ramz Avatar answered Oct 08 '22 01:10

Ramz