每当我运行应用程序时,都会出现此错误。我尝试过所有在线解决方案,但都失败了。错误:(4)解析XML时出错:格式不正确(无效标记)
任何帮助?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="dishname"
android:id="@+id/item_name"
android:textSize="24dp"
android:textColor="#396fd1"
android:layout_alignParentTop="true"
android:layout_alignStart="@+id/item_type" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="price"
android:id="@+id/item_price"
android:textSize="16dp"
android:layout_below="@+id/item_name"
android:layout_toEndOf="@+id/item_name"
android:layout_marginStart="32dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="type"
android:id="@+id/item_type"
android:textSize="12dp"
android:layout_below="@+id/item_name"
android:layout_alignStart="@+id/item_nofingredients" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#"
android:id="@+id/item_nofingredients"
android:textSize="12dp"
android:layout_below="@+id/item_type"
android:layout_alignParentStart="true"
android:layout_marginStart="15dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Ingredients"
android:id="@+id/textView5"
android:textSize="12dp"
android:layout_below="@+id/item_type"
android:layout_toEndOf="@+id/item_type" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/deleteButton"
android:layout_alignBottom="@+id/item_price"
android:layout_alignParentEnd="true"
android:layout_marginEnd="19dp"
android:background="@android:color/transparent"
android:src="@android:drawable/ic_menu_delete"/>
</RelativeLayout>
你缺少一个开放的''标签。 –
@MohammedAoufZOUAG我在这个评论中写了代码的开头 – ghumdan16
用完整的布局代码更新您的文章,而不是在评论中。这里很难阅读。 –