找不到以下类:android.support.v7.internal.app.WindowDecorActionBar [英] The following classes could not be found: 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 已被弃用并由 Toolbar 取代.话虽如此,如果您现在想继续使用 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:
- 在 res 文件夹内的 values 文件夹中打开styles.xml.
- 将 Base 添加到主题名称的开头,使其显示为Base.Theme.AppCompat.Light.DarkActionBar"
- Open styles.xml in the values folder inside the res folder.
- 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屋!