I have a TabLayout where I want the tabs to appear in the center of the screen. Below is the XML for my TabLayout.
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/white"
app:tabGravity="center"
app:tabIndicatorColor="@color/about_tab_selected"
app:tabIndicatorHeight="4dp"
app:tabMode="scrollable"
app:tabPaddingEnd="20dp"
app:tabPaddingStart="20dp"
app:tabSelectedTextColor="@color/about_tab_selected"
app:tabTextAppearance="@style/UGTabTextAppearance"
app:tabTextColor="@color/about_tab_unselected" />
However, my tabs are still displayed on the left, and I cannot concentrate them in Activity.
What I get is:

I really want:

Can someone please tell me what I'm doing wrong here? If you need more information about the rest of XML, let me know.
source
share