Android: How to Remove Selected Tab Highlight Color & On Press Highlight on TabWidget

前端 未结 2 555
野性不改
野性不改 2020-12-20 02:38

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

相关标签:
2条回答
  • 2020-12-20 02:56

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

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

    Cheers.

    0 讨论(0)
  • 2020-12-20 02:59

    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);
    
    0 讨论(0)
提交回复
热议问题