Aracılığıyla paylaş


View.Background Property

Definition

Gets the background drawable -or- Set the background to a given Drawable, or remove the background.

public virtual Android.Graphics.Drawables.Drawable? Background { [Android.Runtime.Register("getBackground", "()Landroid/graphics/drawable/Drawable;", "GetGetBackgroundHandler")] get; [Android.Runtime.Register("setBackground", "(Landroid/graphics/drawable/Drawable;)V", "GetSetBackground_Landroid_graphics_drawable_Drawable_Handler")] set; }
[<get: Android.Runtime.Register("getBackground", "()Landroid/graphics/drawable/Drawable;", "GetGetBackgroundHandler")>]
[<set: Android.Runtime.Register("setBackground", "(Landroid/graphics/drawable/Drawable;)V", "GetSetBackground_Landroid_graphics_drawable_Drawable_Handler")>]
member this.Background : Android.Graphics.Drawables.Drawable with get, set

Property Value

The drawable used as the background for this view, if any.

Attributes

Remarks

Property getter documentation:

Gets the background drawable

Java documentation for android.view.View.getBackground().

Property setter documentation:

Set the background to a given Drawable, or remove the background. If the background has padding, this View's padding is set to the background's padding. However, when a background is removed, this View's padding isn't touched. If setting the padding is desired, please use #setPadding(int, int, int, int).

Java documentation for android.view.View.setBackground(android.graphics.drawable.Drawable).

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