2017-10-24 4 views
1

actionNext nicht funktioniert, wennandroid: imeOptions = "actionNext" funktioniert nicht, wenn Android: input = "textCapWords"

android:inputType="textCapWords" 

aber seine Arbeits in

android:inputType="text" 

Kann jemand Hilfe zu beheben diese

Im folgenden finden Sie meinen Code

<android.support.design.widget.TextInputLayout 
       android:id="@+id/profile_firstNameLay" 
       android:layout_width="match_parent" 
       android:theme="@style/TextLabel1" 
       android:layout_height="wrap_content"> 

       <com.orbiosolutions.yabeee.CustomClasses.CustomEditText 
        android:id="@+id/profile_firstNameTxt" 
        android:textColor="@color/login_txt_color" 
        android:layout_width="match_parent" 
        android:textSize="@dimen/login_med_txt_size" 
        android:imeOptions="actionNext" 
        android:layout_height="wrap_content" 
        android:inputType="textCapWords" 
        android:maxLines="1" 
        android:hint="@string/first_name" /> 

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

haben u Einleiner = true in xml hinzufügen –

Antwort

1

android:singleLin e wurde veraltet, es ist besser, android:maxLines="1" mit android:inputType="text" zu kombinieren. Dies wäre der Code:

<EditText 
     android:id="@+id/editText" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:maxLines="1" 
     android:inputType="text" 
     /> 

ODER

Die hier gegebenen Antworten waren alle sehr hilfsbereit, aber ich war immer noch kämpfen, meine Tastatur auf „Weiter“ um zu zeigen, zu erhalten.

Es stellt sich heraus, dass, wenn Sie Androide's android: digits-Attribut in Ihrem XML verwenden, verhindert, dass das android: imeOptions = "actionNext" wie erwartet funktioniert.

Die Antwort ist eigentlich die Verwendung der veralteten Android: singleLine = "True". Dies scheint die Einhaltung der IME-Option zu erzwingen.

Alt, Non-Working-Code

<android.support.design.widget.TextInputEditText 
     android:id="@+id/first_name" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ- " 
     android:ellipsize="end" 
     android:hint="@string/first_name" 
     android:imeOptions="actionNext" 
     android:inputType="textCapWords" 
     android:maxLength="35" 
     android:maxLines="1" /> 

Arbeits-Code

<android.support.design.widget.TextInputEditText 
     android:id="@+id/first_name" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ- " 
     android:ellipsize="end" 
     android:hint="@string/first_name" 
     android:imeOptions="actionNext" 
     android:inputType="textCapWords" 
     android:maxLength="35" 
     android:maxLines="1" 
     android:singleLine="true" /> 

Ich bin kein Fan von einem veralteten Attribute, aber jetzt scheint es, um das gewünschte Ergebnis zu erhalten.

Hoffe das hilft dir.

0

add single = true

oder

maxLines = 1

in Ihrer .xml-Datei

Verwandte Themen