语言

Fragment.OnViewCreated(View, Bundle) 方法

定义

在返回后 #onCreateView(LayoutInflater, ViewGroup, Bundle) 立即调用,但在将保存状态还原到视图中之前。

[Android.Runtime.Register("onViewCreated", "(Landroid/view/View;Landroid/os/Bundle;)V", "GetOnViewCreated_Landroid_view_View_Landroid_os_Bundle_Handler")]
public virtual void OnViewCreated(Android.Views.View? view, Android.OS.Bundle? savedInstanceState);
[<Android.Runtime.Register("onViewCreated", "(Landroid/view/View;Landroid/os/Bundle;)V", "GetOnViewCreated_Landroid_view_View_Landroid_os_Bundle_Handler")>]
abstract member OnViewCreated : Android.Views.View * Android.OS.Bundle -> unit
override this.OnViewCreated : Android.Views.View * Android.OS.Bundle -> unit

参数

view
View

返回的 #onCreateView(LayoutInflater, ViewGroup, Bundle)视图。

savedInstanceState
Bundle

如果为非 null,则会根据此处给出的先前保存状态重新构造此片段。

特性

注解

在 onCreateView(LayoutInflater,ViewGroup,Bundle)返回之后立即调用,但在还原到视图中的任何保存状态之前。 这样,子类就有机会在子类知道其视图层次结构已完全创建后自行初始化。 但是,片段的视图层次结构目前未附加到其父级。

Android 参考。android.app.Fragment.onViewCreated

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

适用于