Mina Fawzy
Mina Fawzy

Reputation: 21472

android - add done to default android keyboard in portrait mode

I need to add done button in my keyboard

my tries I add

android:imeOptions="actionDone" android:imeActionLabel="DONE" to my Edittext

<EditText
            android:singleLine="true"
            android:id="@+id/passwordtext"
            android:layout_width="match_parent"
            android:imeOptions="actionDone"
            android:imeActionLabel="DONE"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="@string/password"
             />

but I get done in landscape mode only , how can I have done inside off Enter enter image description here

Upvotes: 0

Views: 233

Answers (3)

Neal Ahluvalia
Neal Ahluvalia

Reputation: 1548

Just add

android:imeOptions="actionDone"
android:singleLine="true"

Upvotes: 1

Mina Fawzy
Mina Fawzy

Reputation: 21472

I find answer thanks @Gabe I need to design my own keyboard

but I can change function of Enter button to Done If I add this code to my Edittext

 android:singleLine="true"

Upvotes: 0

Gabe Sechan
Gabe Sechan

Reputation: 93728

What the keyboard displays is completely up to the keyboard (which is its own app). It may decide to honor your request, it may not. There is no way to force it- you've done as much as you can to ask it to do so.

Upvotes: 1

Related Questions