码迷,mamicode.com
首页 > 其他好文 > 详细

Chapter 10 UINavigationController

时间:2014-09-19 19:06:15      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:des   io   os   ar   for   art   sp   cti   on   

 Chapter 10 UINavigationController

1. When your application presents multiple screens of information, a UINavigationController maintains a stack of those screens. Each screen is the view of a UIViewController, and the stack is an array of view controllers. When a UIViewController is on top of the stack, its view is visible.

 

2. The viewControllers array of a navigation controller is dynamic - you start with a root view controller and push view controllers depending on user input, when the stack is popped, the controller is destroyed.  pushViewController:animated:

 

3. When the message endEditing: is sent to a view, if it or any of its subviews is currently the first responder, it will resign its first responder status, and the keyboard will be dismissed. (The argument passed determines whether the first responder should be forced into retirement. Some first responders might refuse to resign, and passing YES ignores that refusal.)

 

4. Like UINavigationItem, UIBarButtonItem is not a subclass of UIView. Instead, UINavigationItem encapsulates information that UINavigationBar uses to configure itself. Similarly, UIBarButtonItem is not a view, but holds the information about how a single button on the UINavigationBar should be displayed. (A UIToolBar also uses instances of UIBarButtonItem to configure itself.)

 

5. UIViewController has an editButtonItem property, and when sent editButtonItem, the view controller creates a UIBarButtonItem with the title Edit. Even better, this button comes with a target-action pair: it sends the message setEditing:animated: to its UIViewController when tapped.

 

6. Dismiss keyboard  with UIResponder’s method:

 

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

{

    [self.view endEditing:YES];

}

 

 

 

 

Chapter 10 UINavigationController

标签:des   io   os   ar   for   art   sp   cti   on   

原文地址:http://www.cnblogs.com/1oo1/p/3981948.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!