相关疑难解决方法(0)

多线EditText,2.3上有完成的SoftInput动作标签

有没有办法让Multi-Line EditText出现并在Android 2.3上使用IME Action Label"Done"?

在Android 2.2中,这不是问题,输入按钮显示IME操作标签"完成"(android:imeActionLabel="actionDone"),并在单击时取消软输入.

配置EditText多线时,Android 2.3无法显示软输入键盘的"完成"操作.

我已经设法通过使用a来改变Soft Input输入按钮的行为KeyListener,但是enter按钮仍然看起来像一个回车键.


这是宣言 EditText

<EditText
        android:id="@+id/Comment"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:layout_marginBottom="0dp"
        android:lines="3"
        android:maxLines="3"
        android:minLines="3"
        android:maxLength="60"
        android:scrollHorizontally="false"
        android:hint="hint"
        android:gravity="top|left"
        android:textColor="#888"
        android:textSize="14dp"
        />
<!-- android:inputType="text" will kill the multiline on 2.3! -->
<!-- android:imeOptions="actionDone" switches to a "t9" like soft input -->
Run Code Online (Sandbox Code Playgroud)

inputType在加载后在活动中设置内容视图时检查值,它显示为:

inputType = 0x20001
Run Code Online (Sandbox Code Playgroud)

这是:

  • class = TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_NORMAL
  • flags = InputType.TYPE_TEXT_FLAG_MULTI_LINE

android android-edittext

80
推荐指数
5
解决办法
4万
查看次数

标签 统计

android ×1

android-edittext ×1