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

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

问题描述

动作栏未显示在开发预览中,但在运行应用程序后正常显示,最小api为15,试图将其从清单文件中删除,未显示动作栏,并且无法再运行该应用程序./p>

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

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

尝试使用整体光源主题时,崩溃并出现错误"java.lang.IllegalStateException:您需要在此活动中使用Theme.AppCompat主题(或后代)."

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

解决方案

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

即使您使用的是Eclipse,它的外观也会相似.

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

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.

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)

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

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."

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

解决方案

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

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

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

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

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