java– 没有为包中的属性’layout_behavior’找到资源标识符

java– 没有为包中的属性’layout_behavior’找到资源标识符,第1张

概述我的应用程序工作正常,直到我尝试添加库.添加库后,AndroidStudio会出现以下错误:Error:(26)Noresourceidentifierfoundforattribute‘layout_behavior’inpackage‘inf..’这是我的build.gradle文件:dependencies{compilefileTree(dir:'libs',include

我的应用程序工作正常,直到我尝试添加库.添加库后,Android Studio会出现以下错误:

Error:(26) No resource IDentifIEr found for attribute
‘layout_behavior’ in package ‘inf..’

这是我的build.gradle文件:

dependencIEs {    compile filetree(dir: 'libs', include: ['*.jar'])    compile 'com.androID.support:appcompat-v7:23.0.1'    compile 'com.androID.support:support-v4:23.0.1'    compile 'com.ogaclejapan.smarttablayout:utils-v4:1.3.0@aar'    compile 'com.ogaclejapan.smarttablayout:library:1.3.0@aar'    compile 'com.jpardogo.materialtabstrip:library:1.1.0'    // compile 'com.lorentzos.swipecards:library:1.0.9@aar'    compile 'com.androID.support:cardvIEw-v7:21.0.3'    compile 'com.androID.support:recyclervIEw-v7:21.0.3'    compile 'com.melnykov:floatingactionbutton:1.3.0'    compile project(':swipelib')}

这是导致错误的xml:

 <androID.support.v4.vIEw.VIEwPager    androID:ID="@+ID/vIEwpager"    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent"    app:layout_behavior="@string/appbar_scrolling_vIEw_behavior"/>

我尝试了以下方法:

>删除了库
>重置AndroID Studio和我的电脑
>从git恢复到以前版本的代码.

但是,错误仍然存​​在.我该如何解决这个问题?

解决方法:

该字符串资源在Material Design支持库中定义.

由于您未使用Material Design支持库中的CoordinatorLayout,因此您应该能够安全地删除app:layout_behavior属性.它可能被削减了&从其他代码粘贴.

注意:如果您实际使用的是CoordinatorLayout并希望协作滚动行为起作用,则需要将最新版本的Material Design Support库的依赖项添加到Gradle构建文件中:

compile 'com.androID.support:design:23.0.1'

更新:请注意,对于最新版本的Gradle,不推荐使用编译配置以支持实现和API配置,因此您的依赖关系可能如下所示:

implementation 'com.androID.support:design:27.0.2'

这只是一个例子;阅读本文时,版本号可能已过期,因此请确保您的版本与您要使用的支持库版本相匹配.

欲了解更多信息:What’s the difference between implementation and compile in gradle

总结

以上是内存溢出为你收集整理的java – 没有为包中的属性’layout_behavior’找到资源标识符全部内容,希望文章能够帮你解决java – 没有为包中的属性’layout_behavior’找到资源标识符所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/web/1103167.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存