【问题标题】:Text that doesn't fit into EditText - scroll it to the left不适合 EditText 的文本 - 向左滚动
【发布时间】:2011-04-26 07:03:26
【问题描述】:

如果我将文本设置为我的 EditText 并且文本更大,则默认行为是文本向右滚动。我可以向左滚动吗?

EditText 8 个字符长和文本“示例文本”的示例:

正常行为:[ple text]

我想要什么:[样品 t]

【问题讨论】:

    标签: android android-edittext


    【解决方案1】:

    将光标/插入符号位置设置为 EditText 的第一个字符。您需要使用setSelection。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-19
      • 1970-01-01
      相关资源
      最近更新 更多