大家好,我有一个项目模块,其中包含一些布局和代码。 问题是我从 lint 中得到了错误
XML Attribute is not allowed it here
例如 android_width
因为 lint 知道该文件夹不在 "app/res/layout"
文件夹中。相反,它位于 "my-lib/res/layout"
文件夹中
我的问题是:- 我怎样才能解决这个问题来理解 lint,这样我就不会出错。
谢谢!
最佳答案
您可以尝试在gradle
文件中手动指定布局文件夹
sourceSets {
main {
res.srcDirs =
[
'path-to-my-lib/res/layout'
]
}
}
关于android - 来自 Android Lint 的 XML 高亮显示错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47886870/