开发者

Text that doesn't fit into EditText - scroll it to the left

开发者 https://www.devze.com 2023-01-20 09:34 出处:网络
If I set text to 开发者_开发知识库my EditText and the text is bigger, the default behaviour is that the text is scrolled to right. Can I scroll it to left?

If I set text to 开发者_开发知识库my EditText and the text is bigger, the default behaviour is that the text is scrolled to right. Can I scroll it to left?

Example with EditText 8 characters long and text "Sample text":

Normal behaviour: [ple text]

What I want: [Sample t]


Set the cursor/caret location to first character of the EditText. You need to use setSelection.

Selection.setSelection(editText.getText(), 0); 
0

精彩评论

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

关注公众号