android - 没有 singleLine 选项的 EditText 的 actionDone

标签 android android-edittext android-softkeyboard

我需要为我的 edittext 设置 actiondone 而不设置单行选项(我需要多行输入)。我该怎么做?

这是代码:

<EditText
    android:id="@+edit_text/title"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:hint="Titolo"
    android:imeOptions="actionNext"
    android:singleLine="true" />

<EditText
    android:id="@+edit_text/content"
    android:layout_width="fill_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    android:gravity="top"
    android:hint="Inserisci la nota"
    android:singleLine="false"
    android:imeOptions="actionDone" />

最佳答案

这对我有用:

    <EditText
        android:id="@+id/name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:imeOptions="actionDone"
        android:singleLine="false" />

关于android - 没有 singleLine 选项的 EditText 的 actionDone,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15281177/

相关文章:

android - 无法解析(或导入)Android 小部件 OnEditorActionListener

android - editText 没有失去焦点

java - android studio 因简单请求而崩溃

android - 根据用户触摸沿其中心旋转 Canvas - Android

android - 如何在 BroadcastReceiver 类中创建待定 Intent ?

android - 在 TextView 中设置字母之间的空格

android-layout - Android - webview 中 TextField 的软键盘

android - 在 WebView 中显示数字键盘

android - windowSoftInputMode 设置为 stateHidden|adjustResize 在 Android 中不起作用

google-play - 在 ICS 上区分平板电脑和智能手机