How To Remove The Selected Tab Indicator From The Fragmenttabhost?
I have tried several links for remove the selected tab in FragmentTabHost but does not work for me . First link Second link I have tried this also in my Xml but it is not working a
Solution 1:
Sorry For Late Reply I am also getting this issue and I tried many things on it and finally I get success.
Try This Below code.
fragmentTabHost.addTab(fragmentTabHost.newTabSpec("tab1").setIndicator("", getResources().getDrawable(R.drawable.tab1)),
HomeFragment.class, null);
fragmentTabHost.getTabWidget().getChildAt(0).setBackground(null);//set child background as null
fragmentTabHost.addTab(fragmentTabHost.newTabSpec("tab2").setIndicator("", getResources().getDrawable(R.drawable.tab2)),
CartFragment.class, null);
fragmentTabHost.getTabWidget().getChildAt(1).setBackground(null););//set child background as null
fragmentTabHost.addTab(fragmentTabHost.newTabSpec("tab3").setIndicator("", getResources().getDrawable(R.drawable.tab3)),
MoreStuffFragment.class, null);
fragmentTabHost.getTabWidget().getChildAt(2).setBackground(null); );//set child background as null
fragmentTabHost.getTabWidget().getChildAt("Your tab position").setBackground(null);
Simply you have to get child and set it's background as null and you have done
Post a Comment for "How To Remove The Selected Tab Indicator From The Fragmenttabhost?"