奇怪的皮棉警告 - 在布局文件中找到意外的文字:"" [英] Strange Lint Warning - Unexpected text found in layout file: ""

查看:211
本文介绍了奇怪的皮棉警告 - 在布局文件中找到意外的文字:""的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有在button_selector.xml定义如下选择

I've got the following selector defined in button_selector.xml

    <?xml version="1.0" encoding="utf-8"?>
    <selector xmlns:android="http://schemas.android.com/apk/res/android">
       <item android:state_pressed="true" 
           android:state_enabled="true"
           android:drawable="@drawable/button_settlement_background_pressed" />
       <item android:state_enabled="true"
           android:drawable="@drawable/button_settlement_background_normal" />
       <item android:state_enabled="false"
           android:drawable="@drawable/button_settlement_background_disabled" />
       </selector>

当我运行皮棉,我得到以下警告:在布局文件中找到意外的文字:。它说,它的第4行发生在绘制。在/ RES /绘制所有引用的可绘制的存在。

When I run lint I get the following warning: Unexpected text found in layout file: "". It says it's happening at line 4 in "drawable". All of the referenced drawables exist in /res/drawable.

有谁知道这可能是造成这?我可以忽略了警告,但我如果可能的话宁愿修复它。

Does anyone know what could be causing this? I can ignore the warning but I'd rather fix it if possible.

另外,我得到了未使用的字符串和图标警告时,他们在AndroidManifest.xml中正在仅引用。有没有办法来解决他们忽略那些呢?

Also, I get warnings for unused strings and icons when they're only referenced in AndroidManifest.xml. Is there a way to fix those instead of ignoring them?

推荐答案

也许有某个地方在白色空间中的不可见的字符。我会尝试(不使用复制和粘贴,这将刚才复制的问题,如果这是发生了什么)重新从头开始的XML。我倒也干净重建项目。

Perhaps there's an invisible character somewhere in the white space. I'd try recreating the xml from scratch (not using copy-and-paste, which would just copy the problem, if that's what's happening). I'd also clean and rebuild the project.

至于未使用的资源的警告,我不认为有一种方法来控制这种情况。误报的问题是非常糟糕的库项目。 Android的皮棉是一个相当新的工具,(在我看来)仍然有很多粗糙的边缘。

As far as the unused resource warnings, I don't think there's a way to control this. The problem of false positives is hugely worse for library projects. Android lint is a fairly new tool and (in my opinion) still has a lot of rough edges.

这篇关于奇怪的皮棉警告 - 在布局文件中找到意外的文字:&QUOT;&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆