语言

AlertDialog.Builder.SetIcon 方法

定义

重载

名称 说明
SetIcon(Drawable)

设置要用于标题的 Drawable。

SetIcon(Int32)

设置要用于标题的 Drawable 的资源 ID。

SetIcon(Drawable)

设置要用于标题的 Drawable。

[Android.Runtime.Register("setIcon", "(Landroid/graphics/drawable/Drawable;)Landroid/app/AlertDialog$Builder;", "GetSetIcon_Landroid_graphics_drawable_Drawable_Handler")]
public virtual Android.App.AlertDialog.Builder SetIcon(Android.Graphics.Drawables.Drawable icon);
[<Android.Runtime.Register("setIcon", "(Landroid/graphics/drawable/Drawable;)Landroid/app/AlertDialog$Builder;", "GetSetIcon_Landroid_graphics_drawable_Drawable_Handler")>]
abstract member SetIcon : Android.Graphics.Drawables.Drawable -> Android.App.AlertDialog.Builder
override this.SetIcon : Android.Graphics.Drawables.Drawable -> Android.App.AlertDialog.Builder

参数

icon
Drawable

可绘制

返回

此 Builder 对象允许链接调用以设置方法

特性

注解

设置要用于标题的 Drawable。 注意:为了确保一致的样式设置,应使用通过 getContext(获取的警报对话框主题上下文)来扩充或构造可绘制。

Android 参考。android.app.AlertDialog.Builder.setIcon

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

SetIcon(Int32)

设置要用于标题的 Drawable 的资源 ID。

[Android.Runtime.Register("setIcon", "(I)Landroid/app/AlertDialog$Builder;", "GetSetIcon_IHandler")]
public virtual Android.App.AlertDialog.Builder SetIcon(int iconId);
[<Android.Runtime.Register("setIcon", "(I)Landroid/app/AlertDialog$Builder;", "GetSetIcon_IHandler")>]
abstract member SetIcon : int -> Android.App.AlertDialog.Builder
override this.SetIcon : int -> Android.App.AlertDialog.Builder

参数

iconId
Int32

int

返回

此 Builder 对象允许链接调用以设置方法

特性

注解

设置要用于标题的 Drawable 的资源 ID。 优先于使用 setIcon(Drawable)设置的值。

Android 参考。android.app.AlertDialog.Builder.setIcon

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于