xml资源中的警告

Cod*_*oet 3 android android-resources android-lint

昨天我再次安装了ADT插件,因为我遇到了问题(间歇性)和我已有的版本.问题是,我没有在我的所有xml资源中收到警告.我很确定我以前没有看过它们.其中一些令人讨厌,因为我无法做任何事情:

Nested weights are bad for performance
The resource R.attr.TextAppearance_Group_Small appears to be unused
Replace "..." with ellipsis character (…, …)?
Run Code Online (Sandbox Code Playgroud)

我必须解决的其他问题包括:

This tag and its children can be replaced by one <TextView/> and a compound drawable
[Accessibility] Missing contentDescription attribute on image
Run Code Online (Sandbox Code Playgroud)

有没有办法压制这些警告?我们有零容忍政策,不允许我们签署警告代码?

小智 11

这些是针对android 的新lint工具的警告,它引入了最新的工具.您可以在Eclipses首选项中更改消息的优先级.

Window -> Preferences -> Android -> Lint Error Checking

在此输入图像描述

请注意,这只会影响您的本地安装.隐藏这些消息不会解决潜在的问题.我猜有人在具有不同偏好的不同机器上检查您的代码可能会得到警告.

  • 谢谢.我发现这个http://tools.android.com/tips/lint建议了一种机制,可以将我们想要忽略的警告添加到lint.xml文件中.然后可以签入此文件,其他人将看不到警告. (2认同)