3
votes

The solution Chase gave for this problem was working fine in 2.2 - 3.2 but when I tested it on 4.0 it failed.

Here is the original post:

Auto Scale TextView Text to Fit within Bounds

On 4.0 I get a strange line spacing problem which brings me to something he/she wrote in his/her code:

// Some devices try to auto adjust line spacing, so force default line spacing 
// and invalidate the layout as a side effect
   textPaint.setTextSize(targetTextSize);
   setLineSpacing(mSpacingAdd, mSpacingMult);

I guess this is failing now and I'm not sure why (anyone?). Also not sure why he/she wrote it in the first place as isn't this OS dependent and not a device dependent problem?

1
Have you tried my solution stackoverflow.com/questions/5033012/… ?M-WaJeEh
Not yet. At some point I will re-visit this issue. Thanks for answering though.Redrori

1 Answers

1
votes

ICS has TextView resizing issue where in some conditions it will resize up but not down. This black magic works for me. After you set the text of your TextView, also perform this

textView.append("\uFEFF");