android - 在当前主题中找不到样式 'coordinatorLayoutStyle'

标签 android android-layout android-studio android-coordinatorlayout

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

布局没有在设计选项卡中呈现,这造成了很多麻烦,尤其是我正在使用协调器布局。

如何解决这个问题?

最佳答案

我通过简单地将这一行插入应用程序主题(应用程序主题通常放在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>

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.

关于android - 在当前主题中找不到样式 'coordinatorLayoutStyle',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49292487/

相关文章:

java - 检查当前时间是否距离 "last_updated"时间超过一个小时

android - 在两个特定的 Android 应用程序之间共享文件

java - 奥利奥 : android. content.res.Resources$NotFoundException

java - Android:我想让recyclerView处于横向模式,所有应用程序处于纵向模式

上传到 Google Play 时 android apk 未对齐

相当于 Matrix.mapPoints() 的 Android OpenGL

android - 新工具栏的 AppCompatActivity 没有正确显示主页按钮?

java - 在android TextView中格式化长段落

Arch Linux 上的 Android Studio 错误

android - 复制的重复文件 (Android Studio 0.4.0)