android - TabHost 和 ActionBar

标签 android

我正在使用 TabHostTabSpec 创建一个具有三个选项卡的 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/

相关文章:

android - 即使在我通过 "export signed application package..."部署 APK 后仍保留日志记录效果

android - ionic 2 : How to check current page is root page in Ionic 2?

android - 比较两个 `Uint8List` 是否相等的正确快速方法是什么?

Android - 动态 TextView 优于之前的 TextView

android - 在 GOOGLE TV ViewFlipper 中看不到任何页面动画

java - JSON 对象 - 如何获取值

java - 如何在 android EditText 中限制单引号?

android - 如何仅使用一个应用程序制作嵌入式 Android 操作系统?

android - 在 Android 应用程序中保存数据模型

android - 如何使用 2 个进程从 1 个 android-app 登录到 1 个日志文件