Setting the text of a TextView when the desired input is larger than ~4000 in String length()
I am trying to setText(string)
on a TextView
component and I am not seeing the text I set. The input String
is larger than 4000 in length()
. I find that if I reduce the text size, the text will display.
How can I setText(string)
on a TextView
with all of the input String
visible witho开发者_如何学编程ut changing the text size of the TextView
?
Do I have to split the input String
and use multiple TextView
objects?
How will I know if the input String
will be too large and not be seen, as my TextView
may be filled with dynamic text?
Let me guess - you have a Samsung phone? Samsung saw fit to modify the operating system to have an implicit maximum size on all TextViews. Why? No idea. But if you specify the length with android:maxLength
, it'll work just fine.
See here: How can I debug a seemingly hardware-dependent issue with my Android app without access to the hardware?
I have the same problem with Sony Ericsson Xperia. I have solved it by using EditText with inputType="none" and editable="false" I hope it will help you.
精彩评论