1

I have this scrollable TabLayout with tabContentStart set to 57dp offset in the XML.

<android.support.design.widget.TabLayout
    android:id="@+id/tabLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:tabContentStart="57dp"
    app:tabMode="scrollable" />

What I want to do now is to change this value in the code in some if/else statement?

I couldn't find out how to achieve this. There doesn't seem to be an equivalent method for this in the TableLayout class.

Thanks for any help in advance.

Sagar Zala
  • 4,854
  • 9
  • 34
  • 62
Dominik
  • 1,703
  • 6
  • 26
  • 46

1 Answers1

0

You can use setPadding or setTranslationX to get the desired effect.

Milind Chaudhary
  • 1,632
  • 1
  • 17
  • 16