我想为所有recyclerview项目创建位图。以下代码仅适用于可见项目。如果我手动滚动,那么它可以捕获。
我想不滚动。任何人都可以帮忙。
View u = holder.ll;
holder.ll.measure(View.MeasureSpec.makeMeasureSpec(595, View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(824, View.MeasureSpec.EXACTLY));
u.setDrawingCacheEnabled(true);
int totalHeight = holder.ll.getMeasuredHeight();
int totalWidth = holder.ll.getMeasuredWidth();
u.layout(0, 0, totalWidth, totalHeight);
u.buildDrawingCache(true);
Bitmap b = Bitmap.createBitmap(u.getDrawingCache());
bitmaps.add(b);
u.setDrawingCacheEnabled(false);