I have created PageTabStrip
and ViewPager
to show multiple list fragments. inside my app viewpager content has a specific width ( it doesn't occupy the whole screen ) partial pages are visible.
as my ViewPager
content has specific width, my PageTabStrip
are not aligned accordingly.
please see the image below , so how do i align the Division
caption under first list and Item
under second list ( second tab is getting out of the screen , see in red)
![enter image description here][1]
I think you misunderstand the concept of viewpager
and PageTabStrip
and misused them with your design requirement.
The viewpager
is a widget that shows each page one at a time and when you swipe you can see the other pages. Other pages are all invisible until you swipe to them, then it shows you one at a time.
The pageTabStrip
helps you to find that which page is currently displayed and what is the title of the next page and previous page if you swipe to those, so it just gives a hint about next and previous pages.
What your picture tells us is you have created a page and set its title Division,(as the pageTabStrip shows) and you have put all of your layouts inside it and you called the next page title ITEM but I think if you swipe to it, it is either empty or just duplicates current view. Your problem is here, if you put all your layouts inside one page you can not set different title for different part of current page, you only can set one title and this title applies to whole layout of current page.
Here is my different solutions to represent your layout:
1) Do not use pageTabStrip or give it a general title for example Search and provide a sub title for each part of current layout with for example linearlayout. It means add a linearlayout above the current page and divide it and put each subtitle in a correct position.
2) Use dual pan fragment design pattern and remove the viewpager.
3) Move search item type section to the next page.