How would I place center my tabs in tablayout?
<com.google.android.material.tabs.TabLayout
android:id="@+id/fraghome_tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabIndicatorColor="@color/standardBlue"/>
I've tried app:tabGravity="center"
but it doesn't make it completely centered, it fills out the entire layout.
Try this:
<com.google.android.material.tabs.TabLayout
android:id="@+id/fraghome_tab_layout"
app:tabIndicatorColor="@color/standardBlue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabMaxWidth="0dp"
app:tabGravity="center"
app:tabMode="fixed"/>
I have got the output by app:tabGravity="center"
Screenshot: