zoukankan      html  css  js  c++  java
  • Chapter 10 UINavigationController

     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];

    }

     

     

     

     

  • 相关阅读:
    Java NIO中的缓冲区Buffer(二)创建/复制缓冲区
    Java NIO中的缓冲区Buffer(一)缓冲区基础
    Java中的反射
    Java SE 9(JDK9)环境安装及交互式编程环境Jshell使用示例
    Spring Data JPA例子[基于Spring Boot、Mysql]
    Spring Session
    Spring Data Redis示例
    Spring IO Platform简介及示例
    使用Spring Boot开发 “Hello World” Web应用
    2017/01/13,今天正好是开通博客园一周年,谈谈自己的一些想法
  • 原文地址:https://www.cnblogs.com/1oo1/p/3981948.html
Copyright © 2011-2022 走看看