Android TabLayout: distribute evenly

后端 未结 1 525
心在旅途
心在旅途 2021-02-04 14:26

I\'m looking at the Google class that was used in the Google IO called SlidingTabLayout. Inside that class, there is a method called setDistributeEvenly which allows all those t

相关标签:
1条回答
  • 2021-02-04 14:58

    I read this tutorial to get my answer: http://panavtec.me/playing-with-the-new-support-tablayout/

    You are suppose to set the tabLayout gravity:

    tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
    

    And do not set your tabLayout to scrollable (app:tabMode="scrollable") otherwise the gravity fill will not work.

    0 讨论(0)
提交回复
热议问题