0

これが私が遭遇しているエラーに関するスクリーンショットです

どうすればこれを修正できますか?

エラー

助けていただければ幸いです

これはXMLコードです:

 <?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="fill_parent"​&gt;
    <TextView​​
​​​​    android:layout_width="fill_parent"​
​​​​    android:layout_height="wrap_content"​
​​​​    android:text="@string/hello"​/>
​​​​
    <TextView
​​​​    android:layout_width="fill_parent"
​​​​    android:layout_height="wrap_content"
​​​​    android:text="This is my first Android Application!" />
    <Button
​​​​    android:layout_width="fill_parent"
​​​​    android:layout_height="wrap_content"
​​​​    android:text="And this is a clickable button!" />
​​​​
    </LinearLayout>
4

2 に答える 2

3
LinearLayout​xmlns:android="http://schemas.android.com/apk/res/android"

する必要があります

LinearLayout ​xmlns:android="http://schemas.android.com/apk/res/android"

そのスペースがないと、最初のXMLタグは無効になります。

完全なXMLは次のようになります。

<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:text="@string/hello" />

    <TextView android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="This is my first Android Application!" />

    <Button android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="And this is a clickable button!" />

</LinearLayout>
于 2012-09-18T19:48:29.780 に答える
3

Strings.xml(res-> valuesに)「hello」という名前の文字列はないと思います。

確認してください。おそらくこれで問題が解決するはずです。

于 2012-09-19T05:36:02.617 に答える