如何解决此错误格式不正确(无效令牌)



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

第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">

可以在关闭标记后添加注释即

<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-->

最新更新