【发布时间】:2010-02-26 04:06:27
【问题描述】:
谁能解释一下原因
public void addView(View child) {
child.setDrawingCacheEnabled(true);
child.setWillNotCacheDrawing(false);
child.setWillNotDraw(false);
child.buildDrawingCache();
if(child.getDrawingCache() == null) { //TODO Make this work!
Log.w("View", "View child's drawing cache is null");
}
setImageBitmap(child.getDrawingCache()); //TODO MAKE THIS WORK!!!
}
总是记录绘图缓存为空,并将位图设置为空?
我必须在设置缓存之前实际绘制视图吗?
谢谢!
【问题讨论】:
-
stackoverflow.com/questions/9791714/… 避免使用
getDrawingCache()使用View#draw到Canvas方法
标签: android android-view