开发者

Android: ScrollView and drawing cache?

开发者 https://www.devze.com 2023-03-24 00:36 出处:网络
Are the views that get scrolled o开发者_StackOverflowff of ScrollView automatically cached by the drawing cache?I\'m not quite sure i understand the API documentation.int PERSISTENT_ALL_CACHES Used to

Are the views that get scrolled o开发者_StackOverflowff of ScrollView automatically cached by the drawing cache? I'm not quite sure i understand the API documentation.


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 no drawing cache should be kept in memory.

int PERSISTENT_SCROLLING_CACHE Used to indicate that the scrolling drawing cache should be kept in memory.


Use these in

public void setPersistentDrawingCache (int drawingCacheToKeep) 

which indicates what types of drawing caches should be kept in memory after they have been 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.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号