-1

Android SDK21バンドルのWindowsx64をインストールしましたが、最初のプロジェクト作成コードにコードを追加しようとすると、エラーが発生するだけです。Hello Worldを実行しようとしましたが、すべてのエントリでエラーが発生しました。ところで:私はAndroidとLinuxの初心者ですが、多くのWindowsプログラミングを行ってきました。ありがとう...

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<EditText android:id="@+id/edit_message"
    android:layout_weight="1"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:hint="@string/edit_message" />
<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/button_send" />
</LinearLayout>

編集:冗長性を削除しました。

4

2 に答える 2

2

あなたの最後のButton(button_send)ビューには親ビューがありませんでした。

あなたはそれを他の人のような見方に入れるべきLinearLayoutです。

于 2012-11-25T11:51:29.497 に答える
0

1)Eclipseをリロードします。2)ProjectCleanを実行します。

于 2012-11-25T11:51:07.623 に答える