1

私の notes_row.xml ファイルのコードは次のようになります

<?xml version="1.0" encoding="utf-8"?>
<TextView android:id="@+id/text1" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:minWidth="100dp"/>
<TextView android:id="@+id/body" xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:padding="10dp"
    android:minWidth="100dp"
    android:fontSize="20dp"/>

次のエラーが表示されます。ルート要素に続くドキュメントのマークアップは整形式でなければなりません。行でxmlns:android="http://schemas.android.com/apk/res/android"

誰かが私が成功するのを手伝ってくれることを願っています。

注: この質問にコピーしたコードはこちらで見つかりました。

4

1 に答える 1

0

私はそれをテストしませんでしたが、この方法を試してください:

<?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:id="@+id/text1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="10dp"
        android:minWidth="100dp"/>
    <TextView android:id="@+id/body"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:padding="10dp"
        android:minWidth="100dp"
        android:fontSize="20dp"/>

</LinearLayout>
于 2012-05-30T19:00:04.107 に答える