【问题标题】:How to resolve this error not well-formed (invalid token)如何解决此错误格式不正确(无效令牌)
【发布时间】:2021-05-08 12:13:52
【问题描述】:

这是我的代码,它显示以下错误

第 6 行给出了这个错误,格式不正确(无效标记)。如何解决这个问题

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    
xmlns:tools="http://schemas.android.com/tools"
    
android:layout_width="match_parent"
    
android:layout_height="match_parent"
    
android:background="@color/greenColor"
    
I have added comment here in <!--  -->
    
tools:context=".MainActivity">

【问题讨论】:

  • 你不能在标签正文中添加评论。

标签: android xml emulation


【解决方案1】:

您可以在关闭标签后添加 cmets 即

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/greenColor"
tools:context=".MainActivity">
<!--This is comment-->

【讨论】:

    猜你喜欢
    • 2018-09-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-27
    • 1970-01-01
    • 2015-08-28
    • 1970-01-01
    相关资源
    最近更新 更多