के शीर्ष पर एंड्रॉइड सेट एरर() संदेश स्क्रॉलिंग मेरी समस्या यह है कि मेरे एडिटटेक्स में त्रुटि संदेश एक्शन बार के शीर्ष पर स्क्रॉल कर रहा है। क्या यह एक एंड्रॉइड बग है, या मैं कुछ गलत कर रहा हूँ?एक्शनबार
यह भी बग तब होता है जब कीबोर्ड डाउन होता है, यह स्क्रीनशॉट में होता है। वहाँ दो छवियों
यहाँ मेरी लेआउट, मैं kiosk_form_table LinearLayout
<ScrollView
style="@style/DefaultBackground"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.6"
android:fadeScrollbars="false"
android:padding="20dp" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingRight="20dp" >
<LinearLayout
android:id="@+id/kiosk_form_table"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<Button
android:id="@+id/kiosk_submit_large"
style="@style/LoginButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:onClick="submit"
android:text="@string/submit" />
</LinearLayout>
</ScrollView>
करने के लिए अपने कोड में EditTexts जोड़ने है कैसे जोड़ा कर रहे हैं - http://imgur.com/fG8bd3E,uFzhOXa#1 <:
यहाँ मैं क्या बात कर रहा हूँ है EditTexts
kiosk_form.addView(getKioskRow(R.layout.kiosk_text_row, "First Name", true, null));
private View getKioskRow(int layout, String header, boolean required, String buttonName)
{
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(layout, null);
view.setTag(required);
addHeader((TextView) inflater.inflate(R.layout.field_header, null), header);
if (required)
((TextView) view.findViewById(R.id.kiosk_input)).setHint("Required");
if (buttonName != null)
((Button) view.findViewById(R.id.kiosk_input_button)).setText(buttonName);
return view;
}
private void addHeader(TextView view, String header)
{
view.setTag(false);
view.setText(header);
kiosk_form.addView(view);
}
मैं कैसे त्रुटि
(TextView) view).setError(getString(R.string.error_field_required));
मैं चाहता हूं कि मेरे त्रुटि संदेश विभिन्न दृश्यों पर दिखाई दें जो टेक्स्टव्यू के सबक्लास हैं, इसलिए यदि आप मेरा अंतिम कोड स्निपेट देखते हैं तो मैं अपने विचारों में एक त्रुटि संदेश जोड़ता हूं, जिनमें से कुछ ग्रंथ संपादित कर रहे हैं। मेरी समस्या यह नहीं है कि त्रुटि दिखाई नहीं दे रही है। मेरी त्रुटि यह है कि जब मैं स्क्रॉल करता हूं, तो पॉप अप संदेश एक्शन बार के शीर्ष पर जाता है जैसा कि मेरे imgur लिंक में देखा गया है (मैं समुदाय के लिए नया हूं, इसलिए मेरे पास लिंक एम्बेड करने के लिए पर्याप्त प्रतिष्ठा नहीं है)। – Sagar
ओह ठीक है मुझे यह मिल गया। यहां एक संभावित समाधान है: जब उपयोगकर्ता दृश्य को स्क्रॉल कर रहा है तो आप त्रुटि संदेश छुपा सकते हैं। जब स्क्रॉल समाप्त हो जाता है तो आप त्रुटि संदेश को फिर से सेट कर सकते हैं और इसे सही स्थान पर दिखाना चाहिए! यहां स्क्रॉल समाप्त होने पर आप कैसे पता लगा सकते हैं: http://stackoverflow.com/questions/2089552/android-how-to-detect-when-a-scroll-has-ended – Oleksiy
हम्म, मैं यह काम देख सकता हूं। जिज्ञासा से बाहर क्या आप सभी त्रुटि संदेशों को बंद करने के लिए जल्दी से जानते हैं, या यदि यह भी संभव है। मैं पूछता हूं क्योंकि अभी मैं उस फॉर्म को पॉप्युलेट करने के लिए बड़ी संख्या में विचारों के माध्यम से लूप करता हूं और जब भी उपयोगकर्ता स्क्रॉल करता है तो त्रुटि संदेशों को बंद करने के लिए मैं सूची के माध्यम से लूप करना चाहता हूं। मदद के लिए धन्यवाद धन्यवाद! – Sagar