xml 资源中的警告

发布于 2024-12-22 05:59:50 字数 538 浏览 1 评论 0原文

昨天我再次安装了 ADT 插件,因为我已经拥有的版本遇到了问题(间歇性)。问题是,我没有在所有 xml 资源中收到警告。我非常确定我以前没有见过他们。其中一些很烦人,因为我对此无能为力:

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

我必须修复的其他问题包括:

This tag and its children can be replaced by one <TextView/> and a compound drawable
[Accessibility] Missing contentDescription attribute on image

有什么方法可以抑制这些警告吗?我们有零容忍政策,不允许我们签入带有警告的代码?

Yesterday I installed ADT plug-in again as I was having problems (intermittent) with the version I already had. The thing is, I'm not getting warnings in all my xml resources. I am pretty darned sure I haven't seem them before. Some of these are annoying because I cannot do anything about it:

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

Others that I've had to fix include:

This tag and its children can be replaced by one <TextView/> and a compound drawable
[Accessibility] Missing contentDescription attribute on image

Is there any way to suppress these warnings? We have a zero tolerance policy which does not allow us to check-in code with warnings?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谈场末日恋爱 2024-12-29 05:59:50

这些是针对 Android 的新 lint 工具的警告,该工具是随最新工具一起引入的。您可以在 Eclipse 首选项中更改消息的优先级。

转到窗口 ->首选项->安卓-> Lint 错误检查

在此处输入图像描述

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

These are warnings of the new lint tool for android, which got introduced with the latest tools. You can change the priority of the messages in Eclipses preferences.

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

enter image description here

Note though that this only affects your local installation. Hiding these messages will not fix the underlying issue(s). I guess someone checking your code on a different machine with different preferences may get the warnings nontheless.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文