Skip to content Skip to sidebar Skip to footer

Android: How To Remove Selected Tab Highlight Color & On Press Highlight On Tabwidget

I am now working with Android TabWidget. I build this TabWidget based on http://mobileorchard.com/android-app-development-tabbed-activities/ I've already add background to the TabW

Solution 1:

I add this and finally works :

tabHost.getTabWidget().getChildTabViewAt(0).setBackgroundDrawable(null);
tabHost.getTabWidget().getChildTabViewAt(1).setBackgroundDrawable(null);
tabHost.getTabWidget().getChildTabViewAt(2).setBackgroundDrawable(null);
tabHost.getTabWidget().getChildTabViewAt(3).setBackgroundDrawable(null);
tabHost.setCurrentTab(0);

Solution 2:

If using a TabLayout object then hiding the indicator can be achieved as follows:

tabLayout.setSelectedTabIndicatorColor(getResources().getColor(R.color.transparent, null));

Cheers.

Post a Comment for "Android: How To Remove Selected Tab Highlight Color & On Press Highlight On Tabwidget"