Font size too large to fit in cache

前端 未结 3 844
醉话见心
醉话见心 2020-11-28 11:24

So i recently switched to android 3.0 (honeycomb) and i\'m having some issues with hardware rendering, specifically at a certain custom view i\'ve written where I use a font

3条回答
  •  心在旅途
    2020-11-28 11:44

    It is really a bug in the Android OS inside the Hardware Acceleration modules. I think that the best way is to ask the system to avoid HW acceleration on TextViews that contain large size text. To do so, just add in the code:

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

提交回复
热议问题