2013-06-10 10 views
6

これは初めてのアンドロイドプログラムです。私はアンドロイドデベロッパートレーニングウェブサイトに従っています。私activity_main.xmlは、次のようになります。layout_hintで指定された名前と一致するリソースが見つかりません

<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" 
android:paddingBottom="@dimen/activity_vertical_margin" 
android:paddingLeft="@dimen/activity_horizontal_margin" 
android:paddingRight="@dimen/activity_horizontal_margin" 
android:paddingTop="@dimen/activity_vertical_margin" 

tools:context=".MainActivity" > 

<EditText android:id="@+id/edit_message" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_hint="@string/edit_message"/> 

今ではエラーを表示し、同じよう警告:

警告 - This text field does not specify an inputType or a hint

エラー - あなたはres/values/strings.xmledit_messageの値を定義する必要がerror:Error:No resource found that matches the given name(at 'layout_hint' with the value '@string/edit_message')

答えて

10

をファイル。警告については、this linkをチェックしてください。

+0

ありがとうございました。エラーは今すぐ消えました。しかし、私はまだ警告メッセージを受けています。 – Nitish

+0

私は私の答えを編集しました。 – Neoh

+0

Thnks。どちらも今行った – Nitish

0

ないアンドロイド:layout_hint = "@文字列/ edit_message"

が、アンドロイド:私が見つけたものヒント= "@文字列/ edit_message"

0

私は同じ問題を抱えていたし、すべての方法を試してみましたし、これはそれ。

私が入力した場合:

android:layout_hint="@string/edit_message" 

をこれが赤だった:

"@string/edit_message" 

私が入力した場合:

android:layout_hint=" @string/edit_message" 

(「最初の後のスペースに注意してください) をその後、これは緑色に変更されました:

" @string/edit_message" 

これは私のために働いた。

関連する問題