Android: ScrollView and drawing cache?

Are views that scroll from ScrollView automatically cached by the drawing cache? I'm not quite sure that I understand the API documentation.

+7
source share
1 answer

int PERSISTENT_ALL_CACHES Used to indicate that all drawing caches should be kept in memory.

int PERSISTENT_ANIMATION_CACHE Used to indicate that the animation drawing cache should be kept in memory.

int PERSISTENT_NO_CACHE Used to indicate that the drawing cache should not be stored in memory.

int PERSISTENT_SCROLLING_CACHE Used to indicate that the cache scroll file should be stored in memory.


Use them in

 public void setPersistentDrawingCache (int drawingCacheToKeep) 

which indicates what types of drawing caches should be stored in memory after they are created.


Example

  setPersistentDrawingCache(ViewGroup.PERSISTENT_SCROLLING_CACHE); setAlwaysDrawnWithCacheEnabled(true); // call this method //to start (true) and stop (false) using the drawing cache //when you perform performance sensitive operations, like scrolling or animating. 
+10
source

All Articles