Just write this method and call after initlize you tablayout.
public static void TabWidth(TabLayout tabLayout, int margin, int indicatorHeight) {
tabLayout.setTabRippleColor(null);
tabLayout.setSelectedTabIndicatorHeight(indicatorHeight);
//int betweenSpace = margin;
ViewGroup slidingTabStrip = (ViewGroup) tabLayout.getChildAt(0);
for (int i = 0; i < slidingTabStrip.getChildCount(); i++) {
View v = slidingTabStrip.getChildAt(i);
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) v.getLayoutParams();
params.leftMargin = margin;
params.rightMargin = margin;
}
}
Recent Comments
Recent Post
8 Financial Considerations of E-Commerce
- August 9, 2024
- 2 min read
Google announces 5 changes to for Mobile
- July 18, 2024
- 0 min read
Top 5 Ecommerce Platforms for Boosting Your
- July 16, 2024
- 2 min read