我如何解决“找不到风格'底部导航风格' [英] How do I resolve "failed to find style 'bottomnavigationstyle'
问题描述
嘿,
我一直在尝试将BottomNavigationView添加到我的Activity中,但是我有一个渲染问题,说在当前主题中未找到样式'bottomnavigationstyle'。
我添加了这个依赖项(没有抛出任何错误,所以我假设它退出)
implementation'com.android.support :设计:28.0.0'
有谁可以帮我解决这个问题?谢谢。
我尝试了什么:
我用Google搜索了这个错误,我读到我已经添加了这个
< item name =coordinatorLayoutStyle> @ style / Widget.Support.CoordinatorLayout
并且它仍然无效。
Hey,
I've been trying to add BottomNavigationView to my Activity but I've got a rendering problem which says "failed to find style 'bottomnavigationstyle' in current theme".
I've added this dependency (didn't throw any error, so I'm assuming it exits)
implementation 'com.android.support:design:28.0.0'
Can anyone help me out with this? Thanks.
What I have tried:
I googled about this error and I read that I've add this
<item name="coordinatorLayoutStyle">@style/Widget.Support.CoordinatorLayout
and It's still not working.
推荐答案
显然这是28.0.0中的错误 - 请参阅 java - 主题错误 - 如何修复? [ ^ ]在此处重现该解决方案...
将以下内容添加到build.gradle
迫使它使用27.0.0
Apparently this is a bug in 28.0.0- see java - Theme Error - how to fix?[^] Reproducing that solution here ...
Add the following to yourbuild.gradle
which forces it to use 27.0.0
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == "com.android.support") {
if (!requested.name.startsWith("multidex")) {
details.useVersion "27.1.1"
}
}
}
}
I不得不升级我的Gradle。那就是问题。
I had to upgrade my Gradle. That was the problem.
这篇关于我如何解决“找不到风格'底部导航风格'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!