sách gpt4 ăn đã đi

Android Lint - 如何隐藏警告 'The resource Xxx appears to be unused'

In lại 作者:IT王子 更新时间:2023-10-28 23:28:33 26 4
mua khóa gpt4 giày nike

我想为某些特定资源禁用(新)Android Lint 警告“资源 Xxx 似乎未使用”。

对于其他 Lint 警告,我可以利用 Quick Assist,它显示了 3 个选项来禁用警告,其中一个是针对该特定文件的。

但是这个警告没有显示任何快速帮助,它在 Eclipse 中以通用黄色警告颜色出现在文件(定义资源的文件)的顶部。

我也尝试手动编辑 lint.xml 文件,如下所示:






但没有运气(我从 Android Lint 引用 đây 中获取了 nhận dạng)。

câu trả lời hay nhất

我今天遇到了这个问题,发现 Improving Your Code with lint页面非常有帮助。在“在 XML 中配置 lint 检查”部分中,它描述了如何忽略特定资源:

You can use the tools:ignore attribute to disable lint checking for specific sections of your XML files. In order for this attribute to be recognized by the lint tool, the following namespace value must be included in your XML file:

namespace xmlns:tools="http://schemas.android.com/tools"

然后您可以将 tools:ignore="UnusedResources" 添加到要忽略的资源中。

关于Android Lint - 如何隐藏警告 'The resource Xxx appears to be unused',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8587462/

26 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress