XML有空的正文吗?

我刚开始使用XML,正在我的Android应用程序中编辑一个布局,它给了我一个错误“XML有空的正文”,有人能告诉我我做错了什么吗?这是我的代码:

<形状xmlns:android=”http://schemas.android.com/apk/res/android"
android:shape=“rectangle”>
<纯色android:color=“@color/orange”&gt&lt/固体>
<(打、击等的)一下
android:width=“2dp”
android:color=“@color/orange”&gt&lt/冲程>
<衬料
android:bottom=“10dp”
android:left=“15dp”
android:right=“15dp”
android:top=“15dp”&gt&lt/填充>
<角
android:bottomLeftRadius=“0dp”
android:bottomRightRadius=“0dp”
android:radius=“1dp”
android:topLeftRadius=“12dp”
android:topRightRadius=“12dp”/>

谢谢

编辑:必须添加空格才能显示前两行

它似乎是通过去掉结束标记并用自动结束标记替换它们而起作用的:

<纯色android:color=“@color/orange”/>
<(打、击等的)一下
android:width=“2dp”
android:color=“@color/orange”/>
<衬料
android:bottom=“10dp”
android:left=“15dp”
android:right=“15dp”
android:top=“15dp”/>
<角
android:bottomLeftRadius=“0dp”
android:bottomRightRadius=“0dp”
android:radius=“1dp”
android:topLeftRadius=“12dp”
android:topRightRadius=“12dp”/>

发表评论