t0m*_*t0m 2 android android-edittext android-view
EditText
目标是将多行与“下一个视图按钮”一起使用android:inputType="textMultiLine"
,例如android:inputType="text"
(见图 2)。
<EditText
android:id="@+id/addAffirmationContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:maxLength="255"
android:imeOptions="flagNoExtractUi" />
Run Code Online (Sandbox Code Playgroud)
我尝试了许多与: 的组合
android:inputType, singleLine, nextFocusDown, nextFocusUp, nextFocusLeft, nextFocusRight, nextFocusForward, imeOptions, lines
,但android:inputType="textMultiLine"
总是强制换行按钮。
在 Nexus 5 Android 7 上测试。
在代码中:
editText.setImeOptions(EditorInfo.IME_ACTION_NEXT);
editText.setRawInputType(InputType.TYPE_CLASS_TEXT);
Run Code Online (Sandbox Code Playgroud)
并在 XML 中:
android:inputType="textMultiLine"
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2776 次 |
最近记录: |