Android - Actionbar 未显示在开发预览中 [英] Android - Actionbar not showing in the development preview

查看:31
本文介绍了Android - Actionbar 未显示在开发预览中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Actionbar 未在开发预览中显示但运行应用程序后正常显示,最小 api 为 15,尝试从清单文件中删除它们,未显示操作栏,并且无法再运行应用程序.

Actionbar not showing in the development preview but showing normally after running the app, minimum api is 15, tried to delete the them from the manifest file, didn't show the actionbar, and can't run the app anymore.

这是一个全新的项目(尝试删除它并重新创建它并使用不同的最小api创建其他几个,仍然没有在开发中显示)

It is a completely new project (tried deleting it and recreating it and creating several other with different minimum api, still not showing in the development)

我的主题是空白的,带有父级 "parent="Theme.AppCompat.Light.DarkActionBar""

My theme is blank with a parent "parent="Theme.AppCompat.Light.DarkActionBar""

尝试使用全息光主题,崩溃并收到错误java.lang.IllegalStateException:您需要在此活动中使用 Theme.AppCompat 主题(或后代)."

Trying to use a holo light theme, crashed and got that error "java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity."

默认活动扩展了 actionbaractivity 而不是活动,现已修复.谢谢

Default activity extends actionbaractivity instead of activity, fixed now. Thanks

推荐答案

检查在 XML 预览屏幕顶部选择了哪个主题.

Check which theme is selected on the top of the XML preview screen.

即使您使用的是 Eclipse,它看起来也很相似.

Even if you're using Eclipse, it will look similar.

您的应用程序正在显示 ActionBar,因为您的 AndroidManifest 有一个显示 ActionBar 的主题.

Your application is displaying the ActionBar because your AndroidManifest has a theme which displays the ActionBar.

这篇关于Android - Actionbar 未显示在开发预览中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆