且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android版的EditText返回键进入下一个文本

更新时间:2021-08-12 06:48:12

比嗅探键简单多了:尝试设置的android:单线=真正的的android:imeOptions =actionNext(至少为单行条目,textviews)。更多在Android documentation为TextView的。

Much simpler than sniffing keys: try setting android:singleLine="true" and android:imeOptions="actionNext" (at least for single-line entry textviews). Read more in the Android documentation for TextView.

更新: SINGLELINE 是的德$ p $现在pcated 的,但你可以离开它。它是可编辑文本的默认行为,只要你不明确设置的android:inputType下=textMultiLine inputType下覆盖建议 SINGLELINE 替换 MAXLINES =1为不管怎么说可编辑文本。

Update: singleLine is deprecated now, but you can leave it out. It's the default behavior for editable text as long as you don't explicitly set android:inputType="textMultiLine", and inputType overrides the suggested singleLine replacement of maxLines="1" for editable text anyways.