2013-06-10 7 views
6

पर मिलता है, मैं वास्तव में नया हूं एंड्रॉइड प्रोग्राम का यह पहला प्रयास है। मैं एंड्रॉइड डेवलपर्स प्रशिक्षण वेबसाइट का पालन कर रहा हूं।कोई संसाधन नहीं मिला जो दिए गए नाम से लेआउट_हिंट

<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"/> 

अब यह एक त्रुटि पता चलता है और तरह की चेतावनी:: मेरी activity_main.xml ऐसा दिखाई देता

चेतावनी - This text field does not specify an inputType or a hint

त्रुटि - error:Error:No resource found that matches the given name(at 'layout_hint' with the value '@string/edit_message')

उत्तर

10

आप res/values/strings.xml में edit_message का मूल्य परिभाषित करने की जरूरत फ़ाइल। चेतावनी के लिए, 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" 

यह मेरे लिए काम किया।

संबंधित मुद्दे

 संबंधित मुद्दे