我正在使用 TabHost
和 TabSpec
创建一个具有三个选项卡的 android 应用程序。
问题是当我启用 Holo.Light.DarkActionBar
时,操作栏出现在选项卡下方。
这是我的代码
TabHost.TabSpec homespec=tabhost.newTabSpec("Home");
homespec.setIndicator("Home",null);
Intent homeintent=new Intent(this,HomeActivity.class);
homespec.setContent(homeintent);
TabHost.TabSpec eventspec=tabhost.newTabSpec("Event");
eventspec.setIndicator("Event");
Intent eventintent=new Intent(this,EventActivity.class);
eventspec.setContent(eventintent);
TabHost.TabSpec profilespec=tabhost.newTabSpec("Profile");
profilespec.setIndicator("Profile");
Intent profileintent=new Intent(this,ProfileActivity.class);
profilespec.setContent(profileintent);
tabhost.addTab(homespec);
tabhost.addTab(eventspec);
tabhost.addTab(profilespec);
最佳答案
尝试将 HomeActivity、EventActivity 和 profileActivity 类的主题更改为 Theme.Holo.light.NoActionBar
关于android - TabHost 和 ActionBar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27860875/