0
如何爲選項卡添加自定義佈局?例如,我想在選項卡中添加圖標和標題。和自定義主動/非主動顏色。代碼:Android自定義選項卡布局
mTabHost = (TabHost) findViewById(android.R.id.tabhost);
mTabHost.setup();
mViewPager = (ViewPager) findViewById(R.id.pager);
mTabsAdapter = new TabsAdapter(this, mTabHost, mViewPager);
TabSpec tab1spec = mTabHost.newTabSpec("tab1").setIndicator("Tab 1");
TabSpec tab2spec = mTabHost.newTabSpec("tab2").setIndicator("Tab 2");
mTabsAdapter.addTab(tab1spec, ConverterFragment.class, savedInstanceState);
mTabsAdapter.addTab(tab2spec, RatesFragment.class, savedInstanceState);
if (savedInstanceState != null) {
mTabHost.setCurrentTabByTag(savedInstanceState.getString("tab"));
}
http://envyandroid.com/archives/326/align-tabhost-at-bottom –