我知道我可以忽略 Lint 中具有 tools:ignore
我的困难是我想忽略几个规则。
就我而言,对于 Google 分析 ga_trackingId
,我想忽略 TypographyDashes 和 MissingTranslation
我试过没有成功
<resources tools:ignore="TypographyDashes|MissingTranslation" xmlns:tools="https://schemas.android.com/tools" >
和
<resources tools:ignore="TypographyDashes,MissingTranslation" xmlns:tools="https://schemas.android.com/tools" >
和
<resources tools:ignore="TypographyDashes MissingTranslation" xmlns:tools="https://schemas.android.com/tools" >
我现在没有主意了。如何在 tools:ignore
中指定多个值?
最佳答案
您需要使用逗号分隔的列表,但不能有空格。
例子:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" // required to work
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="contentDescription,SpUsage" > // comma separated list. NO blanks allowed!
对于有效选项的列表,您可以从命令行获取列表或使用 throrin19 提到的 eclipse lint 错误检查列表:
lint --list > lint_options.txt
关于android - 忽略 Android lint 中的几个警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14459679/