0
我不知道爲什麼我會得到「在根元素之後的文檔中的標記必須正確形成」。我正嘗試在android項目的res/menu下的mainxml中使用以下代碼。請幫助!XML文檔格式不正確
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical|left"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
style="@style/inputLabel"
android:text="@string/cardHolderName" />
<EditText
android:id="@+id/cardHolderNameInput"
style="@style/textInput"
android:layout_width="fill_parent"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
style="@style/inputLabel"
android:text="@string/cardNumber" />
<EditText
android:id="@+id/cardNumberInput"
style="@style/textInput"
android:layout_width="fill_parent"
android:numeric="integer"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
style="@style/inputLabel"
android:paddingRight="40sp"
android:text="@string/expirationDate" />
<TextView
style="@style/inputLabel"
android:text="@string/expirationMonth" />
<EditText
android:id="@+id/expirationMonthInput"
style="@style/textInput"
android:layout_width="50sp"
android:numeric="integer"
android:singleLine="true" />
<TextView
style="@style/inputLabel"
android:paddingLeft="10sp"
android:text="@string/expirationYear" />
<EditText
android:id="@+id/expirationYearInput"
style="@style/textInput"
android:layout_width="50sp"
android:numeric="integer"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
style="@style/inputLabel"
android:text="@string/cvv" />
<EditText
android:id="@+id/cvvInput"
style="@style/textInput"
android:layout_width="fill_parent"
android:numeric="integer"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
style="@style/inputLabel"
android:text="@string/amount" />
<EditText
android:id="@+id/amountInput"
style="@style/textInput"
android:layout_width="fill_parent"
android:numeric="integer|decimal"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal" >
<Button
android:id="@+id/submitAction"
style="@style/action"
android:clickable="true"
android:text="@string/submit" />
</LinearLayout>
</LinearLayout>
</ScrollView>
任何幫助將不勝感激。謝謝。
這是你的xml中唯一的東西嗎?發佈xml文檔的全部內容。此外,文件位於何處以及文件名是什麼? – nedaRM
看起來很好。有你的嘗試清理你的項目?或複製文件的內容。刪除該文件並重新制作,然後將其粘貼回來,可以解決問題。 – nedaRM
抱歉,文件名是在android項目的res/menu文件夾下的main.xml文件。 – DataEnthusiastic