Udostępnij za pośrednictwem


ActionBar.SetIcon Method

Definition

Overloads

SetIcon(Int32)

Set the icon to display in the 'home' section of the action bar.

SetIcon(Drawable)

Set the icon to display in the 'home' section of the action bar.

SetIcon(Int32)

Set the icon to display in the 'home' section of the action bar.

[Android.Runtime.Register("setIcon", "(I)V", "GetSetIcon_IHandler")]
public abstract void SetIcon (int resId);
[<Android.Runtime.Register("setIcon", "(I)V", "GetSetIcon_IHandler")>]
abstract member SetIcon : int -> unit

Parameters

resId
Int32

Resource ID of a drawable to show as an icon.

Attributes

Remarks

Set the icon to display in the 'home' section of the action bar. The action bar will use an icon specified by its style or the activity icon by default.

Whether the home section shows an icon or logo is controlled by the display option #DISPLAY_USE_LOGO.

Java documentation for android.app.ActionBar.setIcon(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.

See also

Applies to

SetIcon(Drawable)

Set the icon to display in the 'home' section of the action bar.

[Android.Runtime.Register("setIcon", "(Landroid/graphics/drawable/Drawable;)V", "GetSetIcon_Landroid_graphics_drawable_Drawable_Handler")]
public abstract void SetIcon (Android.Graphics.Drawables.Drawable? icon);
[<Android.Runtime.Register("setIcon", "(Landroid/graphics/drawable/Drawable;)V", "GetSetIcon_Landroid_graphics_drawable_Drawable_Handler")>]
abstract member SetIcon : Android.Graphics.Drawables.Drawable -> unit

Parameters

icon
Drawable

Drawable to show as an icon.

Attributes

Remarks

Set the icon to display in the 'home' section of the action bar. The action bar will use an icon specified by its style or the activity icon by default.

Whether the home section shows an icon or logo is controlled by the display option #DISPLAY_USE_LOGO.

Java documentation for android.app.ActionBar.setIcon(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.

See also

Applies to