Man Cuzzy Man Cuzzy - 6 months ago 28
Android Question

How to space tab layout text

Guys please i know this is not the best question to asked but am a newbie to android development so please bare with me. Am building an android app with tabs but the result i am getting is not what i wish for. I will like to implement something similar to what whatsapp has.

Below is what i want to do:

My Tab

my app's screenshot

Whatsapp

whatsapp screenshot

Answer

Write this line inside Tablayout app:tabGravity="fill"

for example:

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