You must do this:. TabHost.getTabWidget () setDividerDrawable (R.drawable.tab_divider);
Where R.drawable.tab_divider is the image in your resource directory.
But the key is that you have to do this BEFORE you add any tabs to the tab.
The initialization code for my bookmark looks like this:
private void initializeTabs(int curTab) {
this.tabHost = getTabHost();
tabHost.clearAllTabs();
TabSpec ts1, ts2, ts3, ts4, ts5;
tabHost.getTabWidget().setDividerDrawable(R.drawable.tab_divider);
ts1 = this.setupTab(new TextView(this), tabHost, R.drawable.browse_tab_normal,
mResources.getString(R.string.Browse));
ts2 = this.setupTab(new TextView(this), tabHost, R.drawable.search_tab_normal,
mResources.getString(R.string.Search));
ts3 = this.setupTab(new TextView(this), tabHost, R.drawable.postad_tab_normal,
mResources.getString(R.string.Post));
ts4 = this.setupTab(new TextView(this), tabHost, R.drawable.watchlist_tab_normal,
mResources.getString(R.string.WatchList));
ts5 = this.setupTab(new TextView(this), tabHost, R.drawable.managead_tab_normal,
mResources.getString(R.string.Login));
ts1.setContent(new Intent().setClass(this, BrowseTabActivity.class));
ts2.setContent(new Intent().setClass(this, SearchTabActivity.class));
ts3.setContent(new Intent().setClass(this, PostAdTabActivity.class));
ts4.setContent(new Intent().setClass(this, WatchlistTabActivity.class));
ts5.setContent(new Intent().setClass(this, LoginTabActivity.class));
tabHost.addTab(ts1);
tabHost.addTab(ts2);
tabHost.addTab(ts3);
tabHost.addTab(ts4);
tabHost.addTab(ts5);
...
source
share