<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
Xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Linearlayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientaton="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="确定"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="取消"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
Xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Linearlayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientaton="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="确定"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="取消"
/>
</LinearLayout>
</LinearLayout>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="确定"
/>
</Button>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="取消"
/>
</Button>
后面少了 </Button>
- error: Error parsing XML: not well-formed (invalid token)
- Element type "EditText" must be followed by either attribute specifications, ">" or
"/>".
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</EditText>
这样可以了吗?
Xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Linearlayout///书写错误 xmlns:android="http://schemas.android.com/apk/res/android"
android:orientaton="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="确定"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="取消"
/>
</LinearLayout>
</LinearLayout>
Xmlns:android="http://schemas.android.com/apk/res/android"
Xmlns ---->xmlns
改成
android:orientation="horizontal"
<LinearLayout
Xmlns:android="http://schemas.android.com/apk/res/android"//错误
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Linearlayout //错误xmlns:android="http://schemas.android.com/apk/res/android"
android:orientaton="horizontal"///错误
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="确定"
/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="取消"
/>
</LinearLayout>
</LinearLayout>
输入错误IDE会在错误单词下有红色下划线的楼主注意下