我是java编程新手,现在严格遵循一个教程。直到发生了一些我无法修复的事情时,我已经深入了解它。我搜索谷歌,一遍又一遍地查看代码,并没有看到任何错误。这里是我的代码截图.... nvm我不允许发布图片,因为我是新手,所以这里是代码复制。第一个X表示错误解析XML:没有正确形成(无效标记),第二个X表示XML文档结构必须在同一实体内开始和结束。我感谢所有的帮助,谢谢。解析XML时出错:格式不正确(无效标记)
< ?xml version="1.0" encoding="utf-8"?>
< LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/myMessage"
android:text="@string/hello" />
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/myButton"
android:text="@string/answer"
/>
< LinearLayout--------1st X is located here. The < is not spaced in the code but spaced here because that was the only way i could put it here
android:layout_width="fill_parent"
android:layout_height="20dp"
android:orientation="horizontal">
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:background="#ff0000"
android:textColor="#000000"
android:text="red" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:background="#00ff00"
android:textColor="#000000"
android:text="green" />
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:background="#0000ff"
android:textColor="#000000"
android:text="blue" />
<LinearLayout>---------2nd X is located here. The < is not spaced in the code but spaced here because that was the only way i could put it here and there is a/in between < and LinearLayout
完成XML代码。其不完整 – Akilan