viewwillappear和viewdidload区别

简介: viewwillappear和viewdidload区别

viewWillAppear:

Called when the view is about to made visible. Default does nothing

视图即将可见时调用。默认情况下不执行任何操作

viewDidAppear:

Called when the view has been fully transitioned onto the screen. Default does nothing

视图已完全过渡到屏幕上时调用

viewWillDisappear:

Called when the view is dismissed, covered or otherwise hidden. Default does nothing

视图被驳回时调用,覆盖或以其他方式隐藏。默认情况下不执行任何操作

viewDidDisappear:

Called after the view was dismissed, covered or otherwise hidden. Default does nothing

视图被驳回后调用,覆盖或以其他方式隐藏。默认情况下不执行任何操作


loadView;

This is where subclasses should create their custom view hierarchy if they aren't using a nib. Should never be called directly.

这是当他们没有正在使用nib视图页面,子类将会创建自己的自定义视图层。绝不能直接调用。

viewDidLoad;

Called after the view has been loaded. For view controllers created in code, this is after -loadView. For view controllers unarchived from a nib, this is after the view is set.

在视图加载后被调用,如果是在代码中创建的视图加载器,他将会在loadView方法后被调用,如果是从nib视图页面输出,他将会在视图设置好后后被调用。


相关文章
|
8月前
|
XML Android开发 数据格式
自定义View之重写onMeasure
自定义View之重写onMeasure
71 0
|
存储 缓存 开发工具
RecyclerView#Adapter#notifyDataSetChanged方法后,为何还会新建ViewHolder?
RecyclerView#Adapter#notifyDataSetChanged方法后,为何还会新建ViewHolder?
|
前端开发
View#invalidate是如何调用当前View#onDraw方法的?
View#invalidate是如何调用当前View#onDraw方法的?
聊聊onSaveInstanceState和onRetainNonConfigurationInstance的区别
聊聊onSaveInstanceState和onRetainNonConfigurationInstance的区别
聊聊onSaveInstanceState和onRetainNonConfigurationInstance的区别
ViewModel源码研究之聊聊onSaveInstanceState和onRetainNonConfigurationInstance的区别
ViewModel源码研究之聊聊onSaveInstanceState和onRetainNonConfigurationInstance的区别
ViewModel源码研究之聊聊onSaveInstanceState和onRetainNonConfigurationInstance的区别
|
前端开发 Android开发
【RecyclerView】 六、RecyclerView.ItemDecoration 条目装饰 ( 简介 | onDraw | onDrawOver | getItemOffsets )
【RecyclerView】 六、RecyclerView.ItemDecoration 条目装饰 ( 简介 | onDraw | onDrawOver | getItemOffsets )
192 0
|
前端开发 Java Android开发
自定义控件View之onMeasure调用时机源码分析
终于建了一个自己个人小站:https://huangtianyu.gitee.io,以后优先更新小站博客,欢迎进站,O(∩_∩)O~~ 先上测试代码: MainActivity.java import android.
1234 0
|
XML Android开发 数据格式