Hi guys, at first I played with TabLayout with a few items, then as time went by, the management asked for several additional new categories that needed to be displayed as filters, finally my TabLayout had quite a lot of items so that the width of the cellphone screen could no longer accommodate displaying them proportionally, finally I was inspired by the Google Play Store's category list, and I wanted to make it like that.
Here is the TabLayout configuration so that it allows for horizontal scrolling.
TabLayout
has methodssetTabMode()
that can beMODE_FIXED(default)
anythingMODE_SCROLLABLE
you need. You can also define these in XML withapp:tabMode="scrollable"
.
Done!