Android版的EditText无限的文字长度 [英] Android EditText unlimited text length

查看:526
本文介绍了Android版的EditText无限的文字长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个特定设备的限制(其他则总的可用内存大小)的文本在滚动多行的EditText长度或线数时的android:最大长度和android:MAXLINES未设置?我有一个EditText:

is there a device specific limitation (other then total free memory size) to text length or line count in scrollable multiline EditText when android:maxLength and android:maxLines is NOT set? I have an EditText:

<EditText
  android:editable="false"
  android:id="@+id/sip_log_log"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:layout_weight = "1"
  android:text=""
  android:gravity = "top"
  android:textColor="#00FF00"
  android:background="#000000"
  android:scrollbars="vertical"
  android:focusable="true"
  />

当我打电话

mEditText.setText("some very very loooong string....");

只有文本的第一部分被示出。问题是特定设备。一切正常的HTC感觉或模拟器,但是三星Galaxy S 2确实从来没有表现出比约20页的文字多。我可以修复它​​以某种方式?或者有没有表现出其他一些标准视图中极长的文本(SIP登录我们的SIP客户端),带滚动条的另一种方式?

only the first part of the text is shown. The issue is device specific. Everything works well on HTC Sensation or in emulator, but Samsung Galaxy S 2 does never show more than about 20 pages of the text. Can I fix it in some way? Or is there an alternative way to show extremely long texts (SIP log in our SIP client) in some other standard view with scroll bar?

感谢所有的答复。

推荐答案

添加机器人:最大长度=99999999你的布局文件修复了这个

Adding android:maxLength="99999999" to your layout file fixes this!

这篇关于Android版的EditText无限的文字长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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