2

I have the TextView contains remaining time of timer that must fit its bounds, i.e. less text == larger font
On other devices all are ok, but on ASUS Zenfone 4(ASUS_T00I, 4.4.2, 480x800, hdpi) text stops displaying when font size is bigger then some limit (see screens)

IMPORTANT: Not duplicate of Font size too large to fit in cache

I have the similar issue (that i have already solved) on another device with logs:

ERROR/OpenGLRenderer(2503): Font size to large to fit in cache.

This was solved by this code from question above in my TextView:

setLayerType(View.LAYER_TYPE_SOFTWARE, null);

But not solved this issue

Screens
2 screens above are made on LG G3, and this is how it looks like on other devices
2 screens below are made on ASUS Zenfone 4

enter image description here

uneven
  • 341
  • 2
  • 13
  • So there are no log messages that correspond to this? Could it simply be a fraction too large to fit in the textview. – weston Jul 23 '15 at 08:13
  • You could give this a go: http://stackoverflow.com/questions/5033012/auto-scale-textview-text-to-fit-within-bounds?rq=1 – weston Jul 23 '15 at 08:15
  • @weston, 1) No, there is no any logs. 2) No, fact text size is always less then bounds of textview (if it were so, I would have seen only a fraction, that fits in bounds). 3) i've already tried this lib on this device, same result. Thx for trying to help. – uneven Jul 23 '15 at 09:08

1 Answers1

0

Try the following solutions,

set setLayerType for your TextView

TextView bigText = (TextView) findViewById(R.id.bigtext);
bigText.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

or add android:hardwareAccelerated from manifest.

<application
    android:...
    android:hardwareAccelerated="true" >
    <activity ...>
Prokash Sarkar
  • 11,723
  • 1
  • 37
  • 50