Created
November 2, 2016 19:00
-
-
Save kostovtd/32f85333fa92e72a00fa3495190d58aa to your computer and use it in GitHub Desktop.
A way to add margins between the tabs of a TabLayout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(int i=0; i < mTabLayout.getTabCount(); i++) { | |
View tab = ((ViewGroup) mTabLayout.getChildAt(0)).getChildAt(i); | |
ViewGroup.MarginLayoutParams p = (ViewGroup.MarginLayoutParams) tab.getLayoutParams(); | |
p.setMargins(0, 0, 50, 0); | |
tab.requestLayout(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment