Call to `getDrawingCache` returns null when scroll is enabled

后端 未结 1 645
太阳男子
太阳男子 2020-11-28 15:48

What is missing in this code? This same code works on ICS. On API 8 the scroll appears and some content goes out of screen. How to get the drawing cache in this case?

<
相关标签:
1条回答
  • 2020-11-28 16:05

    I solved it. Created a bitmap of view size and drew the view into it.

    TableLayout page = (TableLayout) findViewById(R.id.page);
    Bitmap pageBmp = Bitmap.createBitmap(page.getWidth(), page.getHeight(), 
                                           Config.ARGB_8888);
    Canvas canvas = new Canvas(pageBmp);
    page.draw(canvas);
    

    Used the pageBmp bitmap..

    0 讨论(0)
提交回复
热议问题