How can I implement a scrollable tabhost like the on in Google PlayStore app?
Asked
Active
Viewed 815 times
-1
![](../../users/profiles/2077248.webp)
Isquierdo
- 651
- 1
- 8
- 25
-
[Here][1] you have, the same question. Use Google next time. [1]: http://stackoverflow.com/questions/16481108/tabhost-tabs-are-not-horizontally-scrolling-when-swiping-using-viewpager – Eliasz Kubala Aug 05 '15 at 19:50
-
http://stackoverflow.com/questions/16544162/android-google-play-like-tabs?rq=1 – IntelliJ Amiya Aug 06 '15 at 10:18
2 Answers
1
You can achieve it by using TabLayout widget and setting mode to scrollable. Example #1
<android.support.design.widget.TabLayout
android:id="@+id/sliding_tabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
app:tabMode="scrollable" />
or in code Example#2:
tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
![](../../users/profiles/4886794.webp)
Sebastian Pakieła
- 2,604
- 14
- 24
1
Google's SlidingTabLayout to display a custom ViewPager title strip as used in Google I/O Android App .For your exact requirement please check sample git demo Android Material Design Template with Material Tabs (SlidingTabs) and Material Navigation Drawer .I hope it will helps you a lot.
![](../../users/profiles/3395198.webp)
IntelliJ Amiya
- 70,230
- 14
- 154
- 181