Android Studio中的布局预览出现以下错误的原因是什么?
渲染问题找不到以下类:- android.support.v7.internal.app.WindowDecorActionBar (修复构建路径,创建类)提示:尝试构建项目。
发布于 2015-11-17 03:40:43
Actionbar已被弃用,并由Toolbar取代。也就是说,如果您现在想继续使用Actionbar,您可以执行以下操作:
我今天遇到了同样的问题,这个解决方案对我很有效。仅供参考,我在Android Studio中,但希望解决方案与Eclipse类似。
仅供参考,这里有一篇很不错的博客文章,内容是在你准备好这样做的时候用工具栏替换操作栏:https://blog.xamarin.com/android-tips-hello-toolbar-goodbye-action-bar/
发布于 2015-11-19 12:19:49
我想你一定是在你的module
设置中依赖"com.android.support:appcompat-v7:23.1.1"
。
ActionBar
已被弃用。
只需在"build.gradle".中将依赖项从'com.android.support:appcompat-v7:23.1.1'
更改为'com.android.support:appcompat-v7:23.0.1'
您还可以将父样式更改为"Theme.AppCompat.Light.NoActionBar"
。
尝试使用Toolbar
而不是ActionBar
。
发布于 2015-12-01 16:51:26
这个很适合我
更改res/ AppTheme /styles.xml中的值父级解决了此问题。替换
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
使用
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
或者您可以从列表中更改接口级别21。
https://stackoverflow.com/questions/33742114
复制相似问题