0

I am developing an android application. I need to use a tablayout on a section of the application. But I'm unable to align the selected tab to the center of the tablayout. Can anyone help me please ?

Ismail Iqbal
  • 2,774
  • 1
  • 25
  • 46

1 Answers1

0

Gravity used to lay out the tabs in the center of the TabLayout.

TabLayout_tabGravity = "GRAVITY_CENTER"

Or

  tabLayout.setTabGravity(TabLayout.GRAVITY_CENTER);
Haroon
  • 538
  • 2
  • 11