Android-android:persistentDrawingCache图片缓存
来源:互联网 发布:java.io jar包下载 编辑:程序博客网 时间:2024/06/05 09:57
android:persistentDrawingCache (Google官方译文)
Defines the persistence of the drawing cache. The drawing cache might be enabled by a ViewGroup for all its children in specific situations (for instance during a scrolling.) This property lets you persist the cache in memory after
its initial usage. Persisting the cache consumes more memory but may prevent frequent garbage collection is the cache is created over and over again. By default the persistence is set to scrolling.
定义绘图的高速缓存的持久性。 绘图缓存可能由一个ViewGroup在特定情况下为其所有的子类启用,例如在一个滚动的过程中。
此属性可以在初次使用后保留在其在内存中的缓存。 坚持缓存会消耗更多的内存,但可能会阻止频繁的垃圾回收是反复创建缓存。 默认情况下持续存在设置为滚动。
Must be one or more (separated by '|') of the following constant values.
Xml文件中可以使用一下的值:
Constant Value Description
Defines the persistence of the drawing cache. The drawing cache might be enabled by a ViewGroup for all its children in specific situations (for instance during a scrolling.) This property lets you persist the cache in memory after
its initial usage. Persisting the cache consumes more memory but may prevent frequent garbage collection is the cache is created over and over again. By default the persistence is set to scrolling.
定义绘图的高速缓存的持久性。 绘图缓存可能由一个ViewGroup在特定情况下为其所有的子类启用,例如在一个滚动的过程中。
此属性可以在初次使用后保留在其在内存中的缓存。 坚持缓存会消耗更多的内存,但可能会阻止频繁的垃圾回收是反复创建缓存。 默认情况下持续存在设置为滚动。
Must be one or more (separated by '|') of the following constant values.
Xml文件中可以使用一下的值:
none0x0The drawing cache is not persisted after use.
animation0x1The drawing cache is persisted after a layout animation.
scrolling0x2The drawing cache is persisted after a scroll.
all0x3The drawing cache is always persisted.
XML中使用:
<android.support.v4.view.ViewPager android:id="@+id/viewpager" android:layout_width="fill_parent" android:layout_height="fill_parent" android:flipInterval="30" android:persistentDrawingCache="animation"/>
也可以在代码中设置
mContainer.setPersistentDrawingCache(ViewGroup.PERSISTENT_ANIMATION_CACHE);
/**
* persistentDrawingCache设置了控件的绘制缓存策略,一共有4中策略:
PERSISTENT_NO_CACHE 说明不在内存中保存绘图缓存;
PERSISTENT_ANIMATION_CACHE 说明只保存动画绘图缓存;可以用来缓存大视图,以保持他们的缓存在每个之间动画。
PERSISTENT_SCROLLING_CACHE 说明只保存滚动效果绘图缓存
PERSISTENT_ALL_CACHES 说明所有的绘图缓存都应该保存在内存中。
*/
0 0
- Android-android:persistentDrawingCache图片缓存
- Android persistentDrawingCache 绘图缓存 使用
- Android Android:persistentDrawingCache
- android:persistentDrawingCache 的含义
- android:persistentDrawingCache="animation"
- android:persistentDrawingCache="animation"
- Android:persistentDrawingCache解释
- android:persistentDrawingCache含义
- android:persistentDrawingCache用法说明
- android:persistentDrawingCache含义
- Android android:persistentDrawingCache的几个默认属性值介绍
- Android缓存:图片缓存管理
- Android图片缓存,三级缓存
- android图片缓存
- Android 远程图片缓存
- Android 图片缓存
- Android图片缓存
- android多级图片缓存
- PHPSession-完全PHP5之session篇
- Hibernate 学习教程
- 14. Longest Common Prefix
- mysql 性能优化
- 链路聚合(Link Aggregation)与权重
- Android-android:persistentDrawingCache图片缓存
- 数据结构实验之链表三:链表的逆置
- APP开发实战20-TCP和UDP区别
- Android中this和getApplicationContext()两种上下文的区别
- Genymotion在Mac下的安装设置调试等一些列问题解决
- 第10、11周项目 继承和派生3
- ios记录-数据存储
- web开发中的cookie和session
- Python如何使用正则表达式匹配中文