How to implement horizontally scrollable tabs?

user1187383 picture user1187383 · Mar 14, 2012 · Viewed 26.3k times · Source

I'm trying to implement this application. At the moment I have designed tabs on it and since I have more than 7 tabs it looks too congested. How can I design it so that the tabwidget is scrollable horizontally. I have seen this design on few of the apps at the market but no clue how to implement this in my app.

One app I saw had a horizontal scrollview where it scrolls on its own and when you press the particular image/button it displays some content. It didn't seem to be tabs I guess.

So does anyone have an idea of this?

Answer

Juozas Kontvainis picture Juozas Kontvainis · Jan 14, 2016

TabLayout from Android design library

<android.support.design.widget.TabLayout
    android:id="@+id/categories"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:tabMode="scrollable" />