开发者

Text that doesn't fit into EditText - scroll it to the 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜