2015-07-21 10 views
5

मेरे पास TextInputLayout के साथ EditText के साथ एक लेआउट है।TextInputLayout ऑटो फोकस

जब लेआउट लोड किया गया है EditText तुरंत संपादन मोड में है, कीबोर्ड ऊपर नहीं है लेकिन कर्सर चमक रहा है और संकेत EditText के अंदर नहीं है लेकिन इसके ऊपर है।

मैं चाहता हूं कि संकेत संपादन टेक्स्ट से एनिमेटेड हो, केवल पहले उपयोग EditText पर क्लिक करता है।

मैं इसे कैसे पूरा कर सकता हूं? मैंने EditText और TextInputLayout दोनों पर clearFocus() की कोशिश की है।

मेरे xml:

<android.support.design.widget.TextInputLayout 
      android:id="@+id/textInputLayout" 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_weight="1"> 

      <EditText 
       android:singleLine="true" 
       android:id="@+id/case_name" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:hint="Case name" > 
       </EditText> 

     </android.support.design.widget.TextInputLayout> 
+1

@Kuffs एंड्रॉयड कोशिश: या तो काम नहीं करता है windowSoftInputMode = "stateHidden" , तुम कोशिश कर सकते हैं। – aviran

+0

शायद मैंने जो प्रश्न सुझाया वह एक अच्छा उदाहरण नहीं था, लेकिन कई अन्य लोग एक ही बात पूछ रहे हैं। कृपया खोज का प्रयोग करें। http://stackoverflow.com/questions/5550429/edittext-android-automatic- फ़ोकस सभी उत्तरों को केवल स्वीकृत लोगों की जांच करें। – Kuffs

+0

इस में सबसे अधिक गतिविधि है http://stackoverflow.com/questions/1555109/stop-edittext-from-gaining-focus-at-activity-startup – Kuffs

उत्तर

-1

इस

editText.setCursorVisible(false) 
+0

जो कर्सर को छुपाता है, लेकिन फ़ोकस अभी भी संपादन टेक्स्ट पर है, जिसका अर्थ है कि इशारा प्रदर्शित नहीं होता है। – aviran

+0

क्या आप मुझे अपना संपादन टेक्स्ट दिखा सकते हैं? –

+0

निश्चित रूप से, मैंने प्रश्न – aviran

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