Android版的EditText如何启动光标指针在所有月底characters-没有结束第一线 [英] Android EditText how to start cursor pointer at the end of all characters- not end of first line

查看:123
本文介绍了Android版的EditText如何启动光标指针在所有月底characters-没有结束第一线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的EditText评论框,它有几行。当用户返回到箱子他们总是在1号线,而不是说行3月底结束,如果有三条线总在框中。我该如何解决这个问题?

I have comment box using EditText and it has several lines. When user returns to the box they are always at end of line 1 rather than end of say line 3 if there are three lines total in the box. How can I fix this?

推荐答案

有可能会或许更容易的方式,但一个方法是使用

There might be easier ways perhaps, but one way is to use

editText.setSelection(editText.getText().length());

您可以把此行的 OnFocusChangeListener ,或在创建方法。

You can place this line inside an OnFocusChangeListener, or in a Create method.

这篇关于Android版的EditText如何启动光标指针在所有月底characters-没有结束第一线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆