我正在尝试创建另一个相对布局,但我收到错误消息“根元素后面的文档中的标记必须格式正确”,所以我希望你能帮助我使另一个相对布局正常工作
这是我的 main.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:gravity="right"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="اضغط على من تريد معرفة المزيد عنه"
android:padding="10dp"
/>
<Button
android:id="@+id/buttontype1"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Start" />
<Button
android:id="@+id/button1"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Start" />
<Button
android:id="@+id/button2"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Stop"/>
<Button
android:id="@+id/button3"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Start" />
<Button
android:id="@+id/button4"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Stop" />
<Button
android:id="@+id/button5"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Start" />
<Button
android:id="@+id/button6"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Stop"/>
<Button
android:id="@+id/button7"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Start" />
<Button
android:id="@+id/button8"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Stop"/>
<Button
android:id="@+id/button9"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Stojjp"/>
</LinearLayout>
<LinearLayout
<Button
android:id="@+id/button8"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="Stop"/>
<Button
android:id="@+id/button9"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="Stojjp"/>
</LinearLayout>
</LinearLayout>
我希望你能帮助我并谢谢
最佳答案
在 android:text="Stojjp"/>
之后的中间有以下行:
</LinearLayout>
删除它,因为内部 LinearLayout
应该位于外部 LinearLayout
内部。
此外,您的内部 LinearLayout
需要有一个结束 >
,以及 android:layout_width
和 android:layout_height
元素才能有效。
关于java - 安卓java : creating another relativelayout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24999280/