Android entfernen EditText Auswahl
I 2 editText
s haben, whenewer ich app starten zuerst (orange) Bearbeiten von Text wird automatisch ausgewählt zu werden.
Ich versuchte klaren Fokus, aber das hatte nicht für mich gearbeitet.
<LinearLayout
style="@style/Widget.CardContent"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/event_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:inputType="textPersonName"
android:hint="@string/edit_text_title" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/txtInputLayoutPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/event_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:inputType="textMultiLine"
android:hint="@string/edit_text_description" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
Wie zuerst bearbeiten Text wie zweite aussehen lassen?
Manchmal Fokus Clearing ist nicht genug, weil das System (Android) nicht weiß, wer um den Fokus zu geben. Nimm das Eltern-Layout 'LinearLayout' und rufe 'requestFocus()' in dieser Ansicht auf, nachdem du 'clearFocus()' auf 'EditText' aufgerufen hast. –