gpt4 book ai didi

android - 忽略 Android lint 中的几个警告

转载 作者:IT老高 更新时间:2023-10-28 23:03:39 24 4
gpt4 key购买 nike

我知道我可以忽略 Lint 中具有 tools:ignore

属性的规则

我的困难是我想忽略几个规则。就我而言,对于 Google 分析 ga_trackingId,我想忽略 TypographyDashesMissingTranslation

我试过没有成功

<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

lint documentation .

关于android - 忽略 Android lint 中的几个警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14459679/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com