How can I implement a scrollable tabhost like the on in Google PlayStore app?
Asked
Active
Viewed 836 times
-1

Isquierdo
- 745
- 1
- 10
- 29
-
[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);

Sebastian Pakieła
- 2,970
- 1
- 16
- 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.

IntelliJ Amiya
- 74,896
- 15
- 165
- 198