LayoutInflater.IFactory.OnCreateView(String, Context, IAttributeSet) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
你可以提供一個在從 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 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。