I want to use ViewPager2
because it is supposed to replace ViewPager
and I hope to get rid of some problems I've had with ViewPager
.
I want to do this:
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/detail_pager_view"
android:layout_height="match_parent"
android:layout_width="match_parent" >
<androidx.viewpager.widget.PagerTabStrip
android:id="@+id/detail_pager_strip"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_width="match_parent" />
</androidx.viewpager2.widget.ViewPager2>
But ViewPager2
complains that it cannot have any children. On the other hand, if I move PagerTabStrip
out of ViewPager2
it complains that it must be a child of a ViewPager
.
So it seems that PagerTabStrip
is not compatible with ViewPager2
. Am I correct?
Is there any current solution to this? (except writing your own PagerTabStrip
)