简体   繁体   中英

Android Kotlin no enter button on Keyboard

I have a problem with no Enter Button on my Keyboard. Where can I set this or what should I do to have here enter Button?? Any Tips?

在此处输入图像描述

xml code to edittext

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:padding="8dp">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <EditText           
            android:id="@+id/bookId"
            android:layout_width="250dp"
            android:layout_height="wrap_content"
            android:layout_marginEnd="10dp"
            android:layout_weight="1"
            android:hint="@string/hint"
            android:inputType="number"
            android:padding="16dp" />

        <Button
            android:id="@+id/parameterBtn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:padding="16dp"
            android:text="@string/go" />
    </LinearLayout>              
</LinearLayout>

Just add imeOptions property to flagNoEnterAction in editText like below.

 <EditText           
            android:id="@+id/bookId"
            android:layout_width="250dp"
            android:layout_height="wrap_content"
            android:layout_marginEnd="10dp"
            android:layout_weight="1"
            android:hint="@string/hint"
            android:inputType="number"
            android:padding="16dp"
            android:imeOptions="flagNoEnterAction" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM