语言

SwitchPreference 构造函数

定义

重载

名称 说明
SwitchPreference(Context)

使用默认样式选项构造新的 SwitchPreference。

SwitchPreference(Context, IAttributeSet)

使用给定样式选项构造新的 SwitchPreference。

SwitchPreference(IntPtr, JniHandleOwnership)

创建 JNI 对象的托管表示形式时使用的构造函数;由运行时调用。

SwitchPreference(Context, IAttributeSet, Int32)

使用给定样式选项构造新的 SwitchPreference。

SwitchPreference(Context, IAttributeSet, Int32, Int32)

使用给定样式选项构造新的 SwitchPreference。

SwitchPreference(Context)

使用默认样式选项构造新的 SwitchPreference。

[Android.Runtime.Register(".ctor", "(Landroid/content/Context;)V", "")]
public SwitchPreference(Android.Content.Context? context);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;)V", "")>]
new Android.Preferences.SwitchPreference : Android.Content.Context -> Android.Preferences.SwitchPreference

参数

context
Context

将设置此首选项样式的上下文

特性

注解

使用默认样式选项构造新的 SwitchPreference。

Java文档android.preference.SwitchPreference.SwitchPreference(android.content.Context)。

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

适用于

SwitchPreference(Context, IAttributeSet)

使用给定样式选项构造新的 SwitchPreference。

[Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;)V", "")]
public SwitchPreference(Android.Content.Context? context, Android.Util.IAttributeSet? attrs);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;)V", "")>]
new Android.Preferences.SwitchPreference : Android.Content.Context * Android.Util.IAttributeSet -> Android.Preferences.SwitchPreference

参数

context
Context

将设置此首选项样式的上下文

attrs
IAttributeSet

与默认值不同的样式属性

特性

注解

使用给定样式选项构造新的 SwitchPreference。

Java文档android.preference.SwitchPreference.SwitchPreference(android.content.Context, android.util.AttributeSet)。

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

适用于

SwitchPreference(IntPtr, JniHandleOwnership)

创建 JNI 对象的托管表示形式时使用的构造函数;由运行时调用。

protected SwitchPreference(IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Android.Preferences.SwitchPreference : nativeint * Android.Runtime.JniHandleOwnership -> Android.Preferences.SwitchPreference

参数

javaReference
IntPtr

nativeint

IntPtr一个包含Java本机接口 (JNI) 对象引用。

transfer
JniHandleOwnership

指示 JniHandleOwnership如何处理 javaReference

注解

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

适用于

SwitchPreference(Context, IAttributeSet, Int32)

使用给定样式选项构造新的 SwitchPreference。

[Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;I)V", "")]
public SwitchPreference(Android.Content.Context? context, Android.Util.IAttributeSet? attrs, int defStyleAttr);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;I)V", "")>]
new Android.Preferences.SwitchPreference : Android.Content.Context * Android.Util.IAttributeSet * int -> Android.Preferences.SwitchPreference

参数

context
Context

将设置此首选项样式的上下文

attrs
IAttributeSet

与默认值不同的样式属性

defStyleAttr
Int32

当前主题中的一个属性,该属性包含对样式资源的引用,该资源提供视图的默认值。 可以是 0,无法查找默认值。

特性

注解

使用给定样式选项构造新的 SwitchPreference。

Java文档android.preference.SwitchPreference.SwitchPreference(android.content.Context, android.util.AttributeSet, int)。

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

适用于

SwitchPreference(Context, IAttributeSet, Int32, Int32)

使用给定样式选项构造新的 SwitchPreference。

[Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;II)V", "")]
public SwitchPreference(Android.Content.Context? context, Android.Util.IAttributeSet? attrs, int defStyleAttr, int defStyleRes);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;II)V", "")>]
new Android.Preferences.SwitchPreference : Android.Content.Context * Android.Util.IAttributeSet * int * int -> Android.Preferences.SwitchPreference

参数

context
Context

将设置此首选项样式的上下文

attrs
IAttributeSet

与默认值不同的样式属性

defStyleAttr
Int32

当前主题中的一个属性,该属性包含对样式资源的引用,该资源提供视图的默认值。 可以是 0,无法查找默认值。

defStyleRes
Int32

样式资源的资源标识符,它提供视图的默认值,仅当 defStyleAttr 为 0 或无法在主题中找到时才使用。 可以是 0,无法查找默认值。

特性

注解

使用给定样式选项构造新的 SwitchPreference。

Java文档android.preference.SwitchPreference.SwitchPreference(android.content.Context, android.util.AttributeSet, int, int)。

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

适用于