无法在当前主题中找到样式"coordinatorLayoutStyle" [英] Failed to find style 'coordinatorLayoutStyle' in current theme

查看:236
本文介绍了无法在当前主题中找到样式"coordinatorLayoutStyle"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用最新版本的android studio(3.0),以及最新的构建工具(27)和类似的API级别.

I'm using the latest version of android studio (3.0), along with latest build tools (27) and similar API level.

布局没有在设计"选项卡中呈现,这引起了很多麻烦,尤其是在我使用协调器布局的情况下.

The layout does not get rendered in the design tab and it's causing a lot of trouble especially that I'm using coordinator layout.

如何解决这个问题?

推荐答案

我通过简单地将此行插入应用程序主题(应用程序主题通常放置在 styles.xml 中)解决了此渲染问题.

I solved this rendering problem by simply inserting this line into the application theme (the app theme is usually placed in styles.xml).

[ SDK 28 ]

<style name="AppTheme">
  <item name="coordinatorLayoutStyle">@style/Widget.Support.CoordinatorLayout</item>
</style>


[ SDK 27 ]

<style name="AppTheme">
  <item name="coordinatorLayoutStyle">@style/Widget.Design.CoordinatorLayout</item>
</style>


如@Chris所建议.如果IDE在 Widget.Support Widget.Design 中找不到 CoordinatorLayout ,只需开始输入"CoordinatorLayout",它应该会为您提供一些帮助选项.

As suggested by @Chris. If the IDE does not find the CoordinatorLayout in Widget.Support or Widget.Design, just start typing "CoordinatorLayout" and it should give you some options.

这篇关于无法在当前主题中找到样式"coordinatorLayoutStyle"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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