So I want to have tabs with default style but I want to handle content by myself. If I try to create them only with:
TabSpec tabT = mainTabHost.newTabSpec("tabT").setIndicator("T");
tabHost.add(tabT);
I get error that content is not specified.
Then I tried to add tabs with tabwidget directly but I don't know how to get default style of tabs.
Any advice?
Try TabContentFactory
with an empty View:
tabSpec.setContent(new EmptyTabFactory());
the factory class:
private class EmptyTabFactory implements TabContentFactory {
@Override
public View createTabContent(String tag) {
return new View(mContext);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With