3

I've researched about this but I couldn't find anything.


When should I use tabMode:fixed, and when should I use tabMode:scrollable? What's the difference between them? Which one of them is best practice?

Ali Bdeir
  • 4,151
  • 10
  • 57
  • 117

2 Answers2

5

tabMode:fixed - the tabs are fixed in your tabbar (not good for long long tabtitles) tabMode:scrollable - you can scroll your tabs horizontally

If you have a lot of tabs or your tabtitles are very long, the best practice is to use tabMode:scrollable

  • If I have 5 tabs - "Recent Campaigns" - "Subscriptions" - "My Campaigns" - "Invitations" - "Contacts", should I use scrollable or fixed? – Ali Bdeir Nov 18 '16 at 14:51
  • Try both and you will see the better choice, but the titles are very long so if would say you have to use scrollable. – Hendrik Kremer Nov 18 '16 at 14:59
1

Use tabMode:fixed

when you know the number of tabs and their titles are fixed and properly showing in design window of android studio. Then use it.

when *tabMode is fixed* tab titles move to next line. and if you inflate custom tab layout then it shows ellipsize at end like ....

But when your Tabs are dynamic and their title's are long(or dynamic). You should use tabMode:scrollable

But you have to create a customTabLayout for handling it. Because you may stuck in this problem. Solution to Problem

Zar E Ahmer
  • 33,936
  • 20
  • 234
  • 300