【问题标题】:"Multiple annotations found at this line"“在此行找到多个注释”
【发布时间】:2015-12-06 06:55:20
【问题描述】:

在这一行找到多个注释: - 错误:解析 XML 时出错:格式不正确(令牌无效) - 与元素类型“Button”关联的属性“android:text”的值不能包含“

<Button
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:text="<"
  android:id="@+id/button3"
  android:layout_alignTop="@+id/button2"
  android:layout_toRightOf="@+id/button2"
  android:layout_toEndOf="@+id/button2" />

有错误是行:

  android:text="<"

【问题讨论】:

标签: android


【解决方案1】:

布局文件只是xml,本身不允许使用&符号。 您将需要使用“& 后跟预定义名称”来使用该符号。

以下是可以在编程中使用的各种xml和html属性 https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-12-16
    • 1970-01-01
    • 1970-01-01
    • 2015-10-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多