语言

ContextThemeWrapper 构造函数

定义

重载

名称 说明
ContextThemeWrapper()

创建没有主题且没有基本上下文的新上下文包装器。

ContextThemeWrapper(Context, Resources+Theme)

使用指定的基本上下文和主题创建新的上下文包装器。

ContextThemeWrapper(Context, Int32)

创建具有指定主题的新上下文包装器。

ContextThemeWrapper(IntPtr, JniHandleOwnership)

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

ContextThemeWrapper()

创建没有主题且没有基本上下文的新上下文包装器。

[Android.Runtime.Register(".ctor", "()V", "")]
public ContextThemeWrapper();
特性

注解

创建没有主题且没有基本上下文的新上下文包装器。

注意: 在对新构造的上下文包装器调用任何其他方法之前, 必须先 附加 #attachBaseContext(Context) 基本上下文。

Java文档android.view.ContextThemeWrapper.ContextThemeWrapper()。

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

适用于

ContextThemeWrapper(Context, Resources+Theme)

使用指定的基本上下文和主题创建新的上下文包装器。

[Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/content/res/Resources$Theme;)V", "", ApiSince=23)]
public ContextThemeWrapper(Android.Content.Context? base, Android.Content.Res.Resources.Theme? theme);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/content/res/Resources$Theme;)V", "", ApiSince=23)>]
new Android.Views.ContextThemeWrapper : Android.Content.Context * Android.Content.Res.Resources.Theme -> Android.Views.ContextThemeWrapper

参数

base
Context

用于基的 Android.Content.Context 值。

theme
Resources.Theme

用于主题的 Android.Content.Res.Resources+Theme 值。

特性

注解

Java文档android.view.ContextThemeWrapper.ContextThemeWrapper(android.content.Context, android.content.res.Resources.Theme)。

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

适用于

ContextThemeWrapper(Context, Int32)

创建具有指定主题的新上下文包装器。

[Android.Runtime.Register(".ctor", "(Landroid/content/Context;I)V", "")]
public ContextThemeWrapper(Android.Content.Context? base, int themeResId);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;I)V", "")>]
new Android.Views.ContextThemeWrapper : Android.Content.Context * int -> Android.Views.ContextThemeWrapper

参数

base
Context

基本上下文

themeResId
Int32

要应用于基础上下文主题的主题的资源 ID

特性

注解

创建具有指定主题的新上下文包装器。

指定的主题将应用于基础上下文的主题之上。 在 themeResId 标识的主题中未显式定义的任何属性都将保留其原始值。

Java文档android.view.ContextThemeWrapper.ContextThemeWrapper(android.content.Context, int)。

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

适用于

ContextThemeWrapper(IntPtr, JniHandleOwnership)

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

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

参数

javaReference
IntPtr

nativeint

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

transfer
JniHandleOwnership

指示 JniHandleOwnership如何处理 javaReference

注解

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

适用于