27
2017
09

view的生命周期

UIViewController中声明如下方法:

//加载视图

- (void)loadView; 

//将要卸载视图

- (void)viewWillUnload NS_DEPRECATED_IOS(5_0,6_0);

//已经卸载视图

- (void)viewDidUnload NS_DEPRECATED_IOS(3_0,6_0); 

//已经加载

- (void)viewDidLoad; 

//视图将要显示

- (void)viewWillAppear:(BOOL)animated;    

//视图已经显示

- (void)viewDidAppear:(BOOL)animated;     

//视图将要隐藏

- (void)viewWillDisappear:(BOOL)animated; 

//视图已经隐藏

- (void)viewDidDisappear:(BOOL)animated; 

//将要调用layoutSubviews

- (void)viewWillLayoutSubviews NS_AVAILABLE_IOS(5_0);

//已经调用layoutSubviews

- (void)viewDidLayoutSubviews NS_AVAILABLE_IOS(5_0);
上一篇:Android View 绘制之Layout源码探索 下一篇:关于AsyncTask的Executor的一些研究