Udostępnij za pośrednictwem


Drawable.Bounds Property

Definition

Return the drawable's bounds Rect. -or- Specify a bounding rectangle for the Drawable.

public Android.Graphics.Rect Bounds { [Android.Runtime.Register("getBounds", "()Landroid/graphics/Rect;", "")] get; [Android.Runtime.Register("setBounds", "(Landroid/graphics/Rect;)V", "GetSetBounds_Landroid_graphics_Rect_Handler")] set; }
[<get: Android.Runtime.Register("getBounds", "()Landroid/graphics/Rect;", "")>]
[<set: Android.Runtime.Register("setBounds", "(Landroid/graphics/Rect;)V", "GetSetBounds_Landroid_graphics_Rect_Handler")>]
member this.Bounds : Android.Graphics.Rect with get, set

Property Value

The bounds of the drawable (which may change later, so caller beware). DO NOT ALTER the returned object as it may change the stored bounds of this drawable.

Attributes

Remarks

Property getter documentation:

Return the drawable's bounds Rect. Note: for efficiency, the returned object may be the same object stored in the drawable (though this is not guaranteed), so if a persistent copy of the bounds is needed, call copyBounds(rect) instead. You should also not change the object returned by this method as it may be the same object stored in the drawable.

Java documentation for android.graphics.drawable.Drawable.getBounds().

Property setter documentation:

Specify a bounding rectangle for the Drawable. This is where the drawable will draw when its draw() method is called.

Java documentation for android.graphics.drawable.Drawable.setBounds(android.graphics.Rect).

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