2025-05-17

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!!!
}
ALWAYS logs that the drawing cache is null, and sets the bitmap to null?
Do I have to actually draw the view before the cache is set?
Thanks!

 

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *