5

I am using Google's new TabLayout from design support library and was wondering how can I center active tab inside that layout.

Currently I am centering whole layout like this:

<android.support.design.widget.TabLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal" />

And now I would like to center active tab inside of that layout. Something like how it was done before TabLayout. No matter how many tabs were there, active one was always in center. How can I accomplish that? Thank you.

user4386126
  • 1,205
  • 5
  • 17
  • 32

1 Answers1

0

Need to use padding for SlidingTabStrip

Look here: https://stackoverflow.com/a/36886331/651770

Community
  • 1
  • 1
Lubos Horacek
  • 1,562
  • 10
  • 28