首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >忽略Android lint中的几个警告

忽略Android lint中的几个警告
EN

Stack Overflow用户
提问于 2013-01-22 21:27:11
回答 4查看 10.1K关注 0票数 25

我知道我可以忽略具有tools:ignore属性的Lint中的规则

我的困难在于我想忽略几条规则。在我的例子中,对于谷歌分析ga_trackingId,我想忽略TypographyDashes和MissingTranslation

我试过了,但没有成功

代码语言:javascript
复制
<resources tools:ignore="TypographyDashes|MissingTranslation" xmlns:tools="https://schemas.android.com/tools" >

代码语言:javascript
复制
<resources tools:ignore="TypographyDashes,MissingTranslation" xmlns:tools="https://schemas.android.com/tools" >

代码语言:javascript
复制
<resources tools:ignore="TypographyDashes MissingTranslation" xmlns:tools="https://schemas.android.com/tools" >

我现在已经没有主意了。如何在tools:ignore中指定多个值

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2013-01-24 19:25:13

这里的问题是在xml资源文件中使用了错误的命名空间uri;

代码语言:javascript
复制
xmlns:tools="https://schemas.android.com/tools"

它应该是http://...协议。issue 43070中对此进行了更详细的讨论

票数 8
EN

Stack Overflow用户

发布于 2013-05-29 16:33:05

您需要使用逗号分隔的列表,但不能有空格。

示例:

代码语言:javascript
复制
<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错误检查列表:

代码语言:javascript
复制
lint --list > lint_options.txt

参见lint documentation

票数 44
EN

Stack Overflow用户

发布于 2013-01-22 21:29:51

你是用eclipse还是intelliJ?

在Eclipse中,进入Window -> Preferences -> Android -> Lint Error Checking

玩得开心;-)

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14459679

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档