Android android:persistentDrawingCache的几个默认属性值介绍

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
none 0x0 The drawing cache is not persisted after use.
animation 0x1 The drawing cache is persisted after a layout animation.
scrolling 0x2 The drawing cache is persisted after a scroll.
all 0x3 The drawing cache is always persisted.
时间: 2024-08-04 07:05:35

Android android:persistentDrawingCache的几个默认属性值介绍的相关文章

查看特定View的默认属性值

当我在分析focus.touch事件处理代码时发现,有些属性对代码的逻辑有非常重要的影响,比如clickable.focusable 这些属性.这时我们自然而然的想到,那么这些属性的默认值是什么呢?在工作中我也很多次有同样的疑问.当初我也不是 很清楚,基本都是手动在xml里面设置下.相信和我一样的人还有很多,今天我就告诉大家怎么通过Android源码来快速查看这些默认值. 比如我们经常用到的TextView,感觉上来说,它应该是不能点击的,也就是clickable默认应该是false.接下来,我

Html标签的css默认属性值

HTML标签CSS默认属性值大全 如果设置了 *{margin:0;padding:0;},当需要使用边距的时候,就需要还原HTML默认CSS值了. 除了inline和block的定义,主要是要注意body|h1~h6|blockquote|menu|ul|ol|dd等标签的默认样式(margin和font-size). html, address,blockquote,body, dd, div,dl, dt, fieldset, form,frame, frameset,h1, h2, h3

Android布局文件layout.xml的一些属性值

第一类:属性值 true或者 false android:layout_centerHrizontal 水平居中 android:layout_centerVertical 垂直居中 android:layout_centerInparent 相对于父元素完全居中 android:layout_alignParentBottom 贴紧父元素的下边缘 android:layout_alignParentLeft 贴紧父元素的左边缘 android:layout_alignParentRight 贴

解决一个 Android开发自定义控件问题,无法读取属性值

今天玩了一下Android自定义控件,是一个TextView和ImageButton的组合控件,所有的都写好了,但是运行得不到想要的结果,找了大半天找不到错误,代码如下: 1.工程目录结构 2.imagebtn_with_text.xml <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res

android中GridView关于间距的属性值介绍

android:columnWidth  设置列的宽度.关联的方法为:setColumnWidth(int)  stretchMode属性值的作用是设置GridView中的条目以什么缩放模式去填充空间.参数stretchMode 可选值:NO_STRETCH,STRETCH_SPACING,STRETCH_SPACING_UNIFORM,或STRETCH_COLUMN_WIDTH android:gravity  设置此组件中的内容在组件中的位置.可选的值有:top.bottom.left.ri

[转]Android布局文件layout.xml的一些属性值

第一类:属性值 true或者 false android:layout_centerHrizontal 水平居中 android:layout_centerVertical 垂直居中 android:layout_centerInparent 相对于父元素完全居中 android:layout_alignParentBottom 贴紧父元素的下边缘 android:layout_alignParentLeft 贴紧父元素的左边缘 android:layout_alignParentRight 贴

Android ellipsize的几种属性值介绍

在开发过程中我们希望看到textview中内容过长的话自动换行,但是调用measureText函数时发现返回值很不准确,单位也不确定,是pixel还是dip,都不准.后来想起textview中有个内容过长加省略号的属性,即ellipsize,可以较偷懒地解决这个问题,哈哈~ 用法如下: 在xml中 android:ellipsize = "end"  省略号在结尾 android:ellipsize = "start"  省略号在开头 android:ellipsi

gridView--GridView关于间距的属性值介绍

android:columnWidth  设置列的宽度.关联的方法为:setColumnWidth(int) android:gravity  设置此组件中的内容在组件中的位置.可选的值有:top.bottom.left.right.center_vertical.fill_vertical.center_horizontal.fill_horizontal.center.fill.clip_vertical 可以多选,用“|”分开.关联方法:setGravity (int gravity) a

关于android 控件的默认属性问题

每个控件都有很多属性 而对于一些属性会有其默认值  而这些默认值是哪里来的? 我们会想到style或者theme 可往往我们使用TextView或者一些常用的控件的时候并没有声明 style属性 或者theme属性啊 下面以最常用的TextView来进行分析 我们知道 开发中缩写的xml 布局文件 最后都会被解析成为一个对象 势必会调用构造方法来创建对象 下面我们来看看TextView的构造方法 <span style="font-size:14px;"> public T