Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Tab width in Tab layout?

People also ask

What is a tab layout?

In Android TabLayout is a new element introduced in Design Support library. It provides horizontal layout to display tabs on the screen. We can display more screens in a single screen using tabs. We can quickly swipe between the tabs.


Add this code in your tab_layout.xml

<android.support.design.widget.TabLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:tabMaxWidth="0dp"
            app:tabGravity="fill"
            app:tabMode="fixed" />

Hope it will works for you...