I am trying to increase icon size of tabs in my app. Icon sizes are fixed tried out many ways but nothing is working, finally tried the following but no change in size.Pleas
As stated in the documentation, you can create a new layout with an ImageView with android:id="@android:id/icon" and set it as the custom view for the tab. The TabLayout will automatically place the icon in the inner ImageView with android:id/icon
Then in you code you can call the setIcon(R.drawable.yourIcon) while you create the tab.
Then you can apply you custom layout within a for loop :
mTabLayout.addTab(mTabLayout.newTab().setIcon(R.drawable.searchpin));
mTabLayout.addTab(mTabLayout.newTab().setIcon(R.drawable.discussionpin));
mTabLayout.addTab(mTabLayout.newTab().setIcon(R.drawable.userpin));
for (int i = 0; i < mTabLayout.getTabCount(); i++) {
TabLayout.Tab tab = mTabLayout.getTabAt(i);
if (tab != null) tab.setCustomView(R.layout.view_home_tab);
}
Here is the xml :