Android View.getDrawingCache returns null, only null

后端 未结 10 863
遇见更好的自我
遇见更好的自我 2020-11-22 13:06

Would anyone please try to explain to me why

public void addView(View child) {
  child.setDrawingCacheEnabled(true);
  child.setWillNotCacheDrawing(false);
          


        
10条回答
  •  有刺的猬
    2020-11-22 13:38

    The error may be bacause your View too large to fit into drawing cache.

    I got the explanation of my "View.getDrawingCache returns null" problem from my logs:

    W/View: View too large to fit into drawing cache, needs 19324704 bytes, only 16384000 available
    

    Android docs also says: Android devices can have as little as 16MB of memory available to a single application. That is why you can not load big bitmap.

提交回复
热议问题