Reputation: 3381
I'm using Android 3.0.
I've created TabHost
with TabWidget
in my layout and I add the tabs during runtime.
I want to get rid of the blue line under the TabWidget
which also indicates on the active tab. I've tried to set the strip to disabled but it didn't help.
How can I do it?
Thanks
Upvotes: 1
Views: 1942
Reputation: 769
If all of above way don't work, please try:
tabHost.getTabWidget().getChildAt(0).setBackground(null);
tabHost.getTabWidget().getChildAt(1).setBackground(null);
...
It work for me.
Upvotes: 1
Reputation: 769
You can use:
tabHost.getTabWidget().getChildAt(0).setBackground(null);
tabHost.getTabWidget().getChildAt(1).setBackground(null);
...
I fixed it by this way.
Upvotes: 0
Reputation: 3381
Well,
I found a solution for this issue.
When creating the TabSpec, I've set an indicator which is an inflated layout resource.
After using this, the strip is not shown anymore on the tabs' header.
// Inflates the icon layout for the tab
LinearLayout tabIconLayout = inflater.inflate(R.layout.tab_indicator, null);
TabSpec tabSpec = tabsHost.newTabSpec("...")
.setIndicator(tabIconLayout)
.setContent(mContentFactory);
mSocialNetworkTabsHost.addTab(tabSpec);
Thanks anyway for your help
Upvotes: 0
Reputation: 1751
this should normally do it. how did you disable the strip?
tabHost.getTabWidget().setStripEnabled(false);
Upvotes: 0