找不到以下类别:android.support.v7.internal.app.WindowDecorActionBar [英] The following classes could not be found: android.support.v7.internal.app.WindowDecorActionBar

查看:143
本文介绍了找不到以下类别:android.support.v7.internal.app.WindowDecorActionBar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是什么原因导致Android Studio中的布局预览出现以下错误?

What causes the following error in the layout preview in Android Studio?

渲染问题找不到以下类: -android.support.v7.internal.app.WindowDecorActionBar(修复构建路径,创建类) 提示:尝试构建项目.

Rendering Problems The following classes could not be found: - android.support.v7.internal.app.WindowDecorActionBar (Fix Build Path, Create Class) Tip: Try to build the project.

推荐答案

不推荐使用操作栏,并已将其替换为工具栏.话虽如此,如果您现在想继续使用Actionbar,可以执行以下操作:

The Actionbar has been deprecated and replaced by Toolbar. That being said, you can do the following if you want to continue using Actionbar for now:

  1. 在res文件夹内的values文件夹中打开styles.xml.
  2. 在主题名称的开头添加 Base 一词,使其显示为"Base.Theme.AppCompat.Light.DarkActionBar"
  1. Open styles.xml in the values folder inside the res folder.
  2. Add the word Base to the beginning of the theme name so that it reads "Base.Theme.AppCompat.Light.DarkActionBar"

我今天遇到了同样的问题,该解决方案对我有用.仅供参考,尽管我在Android Studio中,但是希望该解决方案与Eclipse类似.

I had the same issue today and this solution worked for me. FYI I am in Android Studio though, but hopefully,the solution is similar for Eclipse.

仅供参考,以下是一篇不错的博客文章,内容涉及准备好用工具栏替换操作栏的情况: https://blog.xamarin.com/android-tips-hello-toolbar-goodbye-action-bar/

FYI here is a decent blog post on replacing the Actionbar with the Toolbar for when you are ready to do so: https://blog.xamarin.com/android-tips-hello-toolbar-goodbye-action-bar/

这篇关于找不到以下类别:android.support.v7.internal.app.WindowDecorActionBar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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