开发者

How to set text position programmatically in EditText class?

开发者 https://www.devze.com 2023-01-01 05:38 出处:网络
Does smomeone know how I set the scrollbar position in an EditView programmatically. I\'m appending the text during special events but I want the EditView to 开发者_JAVA百科scroll down to the latest

Does smomeone know how I set the scrollbar position in an EditView programmatically.

I'm appending the text during special events but I want the EditView to 开发者_JAVA百科scroll down to the latest text added so it'll be visible. But default the scrollbar does not move automatically when appending text.

/ Henrik


Just call yourEditText.scrollBy(int x, int y) after you added text to your EditText. Maybe you have to test some values until you find the appropriate values

0

精彩评论

暂无评论...
验证码 换一张
取 消