语言

LayoutInflater.IFactory.OnCreateView(String, Context, IAttributeSet) 方法

定义

挂钩,可以从 LayoutInflater 进行膨胀时提供该调用。

[Android.Runtime.Register("onCreateView", "(Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View;", "GetOnCreateView_Ljava_lang_String_Landroid_content_Context_Landroid_util_AttributeSet_Handler:Android.Views.LayoutInflater/IFactoryInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Android.Views.View? OnCreateView(string name, Android.Content.Context context, Android.Util.IAttributeSet attrs);
[<Android.Runtime.Register("onCreateView", "(Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View;", "GetOnCreateView_Ljava_lang_String_Landroid_content_Context_Landroid_util_AttributeSet_Handler:Android.Views.LayoutInflater/IFactoryInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member OnCreateView : string * Android.Content.Context * Android.Util.IAttributeSet -> Android.Views.View

参数

name
String

要膨胀的标记名称。

context
Context

正在在其中创建视图的上下文。

attrs
IAttributeSet

XML 文件中指定的通胀属性。

返回

查看新建的视图。 返回默认行为的 null。

属性

注解

挂钩,可以从 LayoutInflater 进行膨胀时提供该调用。 可以使用此选项自定义 XML 布局文件中可用的标记名称。

请注意,最好将这些自定义名称与包(即 com.coolcompany.apps)作为前缀,以避免与系统名称冲突。

适用于 . 的 android.view.LayoutInflater.Factory.onCreateView(java.lang.String, android.content.Context, android.util.AttributeSet)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于