在XML元素的开始和结束标记内部进行注释时,“标记开始未关闭”

[英]“Tag start is not closed” when commenting inside XML element's start and end tag


<!-- Comment --> is the way to add comments in an XML file. Doesn't that actually means, that this part is not "compiled"?

<! - Comment - >是在XML文件中添加注释的方法。这实际上是不是意味着这部分不是“编译”的?

However, when I do something like this:

但是,当我做这样的事情时:

<item android:id="@+id/ss3"
    android:icon="@drawable/some_icon"
    android:title="Blabla Title"
    tools:ignore="AppCompatResource"
    <!-- -->
/>

I get an error "Tag start is not closed". Why?

我收到错误“标签启动未关闭”。为什么?

1 个解决方案

#1


6  

Comments are not allowed inside tags. You have to close the tag first with ">" or "/>" and then you can add your comment there.

标签内不允许注释。您必须先使用“>”或“/>”关闭代码,然后才能在那里添加评论。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2014/09/07/752d6c0422588bd1bffcf0bb649bf56a.html



 
© 2014-2018 ITdaan.com 粤ICP备14056181号