ViewGroup.PersistentDrawingCache Property

Definition

Returns an integer indicating what types of drawing caches are kept in memory. -or- Indicates what types of drawing caches should be kept in memory after they have been created.

public virtual Android.Views.PersistentDrawingCaches PersistentDrawingCache { [Android.Runtime.Register("getPersistentDrawingCache", "()I", "GetGetPersistentDrawingCacheHandler")] get; [Android.Runtime.Register("setPersistentDrawingCache", "(I)V", "GetSetPersistentDrawingCache_IHandler")] set; }
[<get: Android.Runtime.Register("getPersistentDrawingCache", "()I", "GetGetPersistentDrawingCacheHandler")>]
[<set: Android.Runtime.Register("setPersistentDrawingCache", "(I)V", "GetSetPersistentDrawingCache_IHandler")>]
member this.PersistentDrawingCache : Android.Views.PersistentDrawingCaches with get, set

Property Value

one or a combination of #PERSISTENT_NO_CACHE, #PERSISTENT_ANIMATION_CACHE, #PERSISTENT_SCROLLING_CACHE and #PERSISTENT_ALL_CACHES

Attributes

Remarks

Property getter documentation:

Returns an integer indicating what types of drawing caches are kept in memory.

This member is deprecated. The view drawing cache was largely made obsolete with the introduction of hardware-accelerated rendering in API 11. With hardware-acceleration, intermediate cache layers are largely unnecessary and can easily result in a net loss in performance due to the cost of creating and updating the layer. In the rare cases where caching layers are useful, such as for alpha animations, #setLayerType(int, Paint) handles this with hardware rendering. For software-rendered snapshots of a small part of the View hierarchy or individual Views it is recommended to create a Canvas from either a Bitmap or android.graphics.Picture and call #draw(Canvas) on the View. However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as android.graphics.Bitmap.Config#HARDWARE Config.HARDWARE bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback reports or unit testing the PixelCopy API is recommended.

Java documentation for android.view.ViewGroup.getPersistentDrawingCache().

Property setter documentation:

Indicates what types of drawing caches should be kept in memory after they have been created.

This member is deprecated. The view drawing cache was largely made obsolete with the introduction of hardware-accelerated rendering in API 11. With hardware-acceleration, intermediate cache layers are largely unnecessary and can easily result in a net loss in performance due to the cost of creating and updating the layer. In the rare cases where caching layers are useful, such as for alpha animations, #setLayerType(int, Paint) handles this with hardware rendering. For software-rendered snapshots of a small part of the View hierarchy or individual Views it is recommended to create a Canvas from either a Bitmap or android.graphics.Picture and call #draw(Canvas) on the View. However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as android.graphics.Bitmap.Config#HARDWARE Config.HARDWARE bitmaps, real-time shadows, and outline clipping. For screenshots of the UI for feedback reports or unit testing the PixelCopy API is recommended.

Java documentation for android.view.ViewGroup.setPersistentDrawingCache(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also