マルチラインをEditText
存在させ、Android 2.3でIMEアクションラベル「完了」を使用する方法はありますか?
Android 2.2では、これは問題ではありません。EnterボタンはIMEアクションラベル「Done」(android:imeActionLabel="actionDone"
)を表示し、クリックするとソフト入力を閉じます。
EditText
複数行用に構成する場合、Android 2.3では、ソフト入力キーボードの「完了」アクションを表示する機能が削除されます。
を使用してソフト入力Enterボタンの動作を変更することができましたKeyListener
が、Enterボタンはまだ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 -->
inputType
アクティビティでコンテンツビューを設定してロードした後に値を確認すると、次のように表示されます。
inputType = 0x20001
これは:
- クラス=
TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_NORMAL
- フラグ=
InputType.TYPE_TEXT_FLAG_MULTI_LINE