我知道我可以忽略具有tools:ignore
属性的Lint中的规则
我的困难在于我想忽略几条规则。在我的例子中,对于谷歌分析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
中指定多个值
发布于 2013-01-24 19:25:13
这里的问题是在xml资源文件中使用了错误的命名空间uri;
xmlns:tools="https://schemas.android.com/tools"
它应该是http://...
协议。issue 43070中对此进行了更详细的讨论
发布于 2013-05-29 16:33:05
您需要使用逗号分隔的列表,但不能有空格。
示例:
<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
发布于 2013-01-22 21:29:51
你是用eclipse还是intelliJ?
在Eclipse中,进入Window -> Preferences -> Android -> Lint Error Checking
玩得开心;-)
https://stackoverflow.com/questions/14459679
复制相似问题