Bitmap from TextView (getDrawingCache) always null

前端 未结 3 1861
终归单人心
终归单人心 2021-01-18 07:22

I am trying to extract the bitmap associated to the displayed TextView instance, but it always returns a null value. What Am I doing wrong? Should I use textview.draw(canvas

3条回答
  •  深忆病人
    2021-01-18 07:52

    Android has a maximum drawing cache size. If the drawing cache would be bigger than that, getDrawingCache() returns null. See the answer to this question.

    You can find a workaround in the answer to this question.

提交回复
热议问题