标签:style io color ar os sp div on log
UINavigationController 是IOS中规定多视图控制器,本身也是试图控制器,也自带一个试图,根视图上方携带有navigtionBar(导航条)
initWithRootViewController
初始化时指定一个导航控制器的根视图控制器
导航控制器管理多个视图控制器的方式:原理:以栈的形式管理,当push时视图控制器进栈, 当POP时视图控制器出栈,视图控制器对象空间回收,屏幕上永远显示的是栈顶元素的根视图
//视图将要出现
- (void)viewWillAppear:(BOOL)animated {
[super
viewWillAppear:animated];
NSLog(@"%s %d",
__FUNCTION__, __LINE__); }
//视图已经出现 - (void)viewDidAppear:(BOOL)animated
{ [super
viewDidAppear:animated];
NSLog(@"%s %d",
__FUNCTION__, __LINE__); }
视图将要消失 -(void)viewWillDisappear:(BOOL)animated
{ [super
viewWillDisappear:animated];
NSLog(@"%s %d",
__FUNCTION__, __LINE__); }
//视图已经消失 -(void)viewDidDisappear:(BOOL)animated
{ [super
viewDidDisappear:animated];
NSLog(@"%s %d",
__FUNCTION__, __LINE__); }
视图的显示与消失
视图从a进入到b时,a-viewwillDisappear--->b-viewDidDisappear--->B-viewDidAppear
当从b返回到a时
b-viewWillDisappear--->a-viewWillAppear--->B-viewDidDisappear--->a-viewDisAppear
标签:style io color ar os sp div on log
原文地址:http://blog.csdn.net/snn5love11314/article/details/40989013