Android Tab Plugin with Many Tabs

I am creating an application that uses Tab Layout. The requirement of the application is that there should be many tabs. Creating 4-5 tabs on the tab bar was fine. But when more than 5 tabs are added, it becomes very compressed. Is there a way in android where I can have many tabs and not make it look compressed? maybe some, for example, having the "Advanced" button on the tab or having horizontal scrollable tabs?

I forgot to mention this earlier that it should work on Android 2.2 (api 8)

thanks

+4
source share
1 answer

Add a line for the layout of the tab

app:tabMode="scrollable" 

into your xml file for example

  <android.support.design.widget.TabLayout android:id="@+id/tabs" android:layout_width="wrap_content" android:layout_height="wrap_content" app:tabMode="scrollable" app:tabTextColor="@color/colorWhite" app:tabSelectedTextColor="@color/colorSecondary" android:background="@color/colorPrimary" app:tabIndicatorColor="@color/colorSecondary" app:tabIndicatorHeight="5dp"/> </android.support.design.widget.AppBarLayout> 
+3
source

Source: https://habr.com/ru/post/1396213/


All Articles