我现在正在使用Android TabWidget.
我基于
http://mobileorchard.com/android-app-development-tabbed-activities/构建了这个TabWidget
我已经为TabWidget添加了背景,
但显然所选标签和按下标签的亮点始终可见,我无法将其关闭.
我想要的是默认选择的标签颜色和按下的标签颜色不可见或关闭,因此图像背景将完全显示,而不是被这些颜色阻止.
任何回应将不胜感激.谢谢 :)
代码:
public void onCreate(Bundle savedInstanceState) {
//hide title bar
BasicDisplaySettings.toggleTaskBar(EpolicyMainActivity.this, false);
//show status bar
BasicDisplaySettings.toggleStatusBar(EpolicyMainActivity.this, true);
super.onCreate(savedInstanceState);
setContentView(R.layout.epolicy);
TabHost tabHost=(TabHost)findViewById(R.id.tabHost);
tabHost.setup();
tabHost.getTabWidget().setBackgroundColor(0);
tabHost.getTabWidget().setBackgroundResource(R.drawable.epolicy_menu_bar);
TabSpec spec1=tabHost.newTabSpec("Tab 1");
spec1.setContent(R.id.tab1);
spec1.setIndicator("",getResources().getDrawable(R.drawable.epolicy_menu_home));
TabSpec spec2=tabHost.newTabSpec("Tab 2");
spec2.setContent(R.id.tab2);
spec2.setIndicator("",getResources().getDrawable(R.drawable.epolicy_menu_nab));
TabSpec spec3=tabHost.newTabSpec("Tab 3");
spec3.setContent(R.id.tab3);
spec3.setIndicator("",getResources().getDrawable(R.drawable.epolicy_menu_contact));
TabSpec spec4=tabHost.newTabSpec("Tab 4");
spec4.setContent(R.id.tab4);
spec4.setIndicator("",getResources().getDrawable(R.drawable.epolicy_menu_agen));
tabHost.addTab(spec1);
tabHost.addTab(spec2);
tabHost.addTab(spec3);
tabHost.addTab(spec4);