Implementing Navigation with UINavigationController

Problem

You would like to allow your users to move from one view controller to the other with a smooth and built-in animation.

Solution

Use an instance of UINavigationController.

  1. #import "AppDelegate.h"
  2. #import "FirstViewController.h"
  3. @interface AppDelegate ()
  4. @property (nonatomic, strong) UINavigationController *navigationController; @end
  5. @implementation AppDelegate ...
  1. - (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
  2. FirstViewController *viewController = [[FirstViewController alloc]
  3. initWithNibName:nil
  4. bundle:nil];
  5. self.navigationController = [[UINavigationController alloc]
  6. initWithRootViewController:viewController];
  7. self.window = [[UIWindow alloc]
  8. initWithFrame:[[UIScreen mainScreen] bounds]];
  9. self.window.rootViewController = self.navigationController;
  10. self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible];
  11. return YES;
  12. }

如下图所示,我们得到了一个能够跳转的view.

这个是详情页面

Implementing Navigation with UINavigationController的更多相关文章

  1. IOS 7 Study - Implementing Navigation with UINavigationController

    ProblemYou would like to allow your users to move from one view controller to the other witha smooth ...

  2. 1: 介绍Prism5.0 Introduction to the Prism Library 5.0 for WPF(英汉对照版)

     Prism provides guidance designed to help you more easily design and build rich, flexible, and easy- ...

  3. 从Cell的视图推出一个新的界面

    先写一个方法, 强制增加一个navigation的属性. 这样self就可以调出来navigation了 - (UINavigationController*)naviController { for ...

  4. Start Developing iOS Apps Today

    view types - view常见类型

  5. UINavigationController出现nested push animation can result in corrupted navigation bar的错误提示

    今天在測试过程中,出现了这样一个bug.分别有两种情景: (前提是:app是基于UINavigationController构建的) 1.从Controller-A中push进来B.在B中点击返回,返 ...

  6. [Angular HTML] Implementing The Input Mask Cursor Navigation Functionality -- setSelectionRange

    @HostListener('keydown', ['$event', '$event.keyCode']) onKeyDown($event: KeyboardEvent, keyCode) { i ...

  7. iOS Programming UINavigationController

    iOS Programming UINavigationController the Settings application has multiple related screens of info ...

  8. iOS第八课——Navigation Controller和Tab bar Controller

    今天我们要学习Navigation Controller和Tab bar Controller. Navigation Controller是iOS编程中比较常用的一种容器,用来管理多个视图控制器. ...

  9. navigation controller

    一.程序框架 1.程序结构

随机推荐

  1. neutron中创建子网时禁用dhcp服务的问题

    在neutron中创建provider网络时,可以指定是否禁用dhcp.若禁用,就可以使用物理网络中的dhcp服务.若使用物理网络的dhcp,就要禁用子网中提供的.如图

  2. 常见的MYSQL高可用解决方案

    MySQL 是一种关系数据库管理系统,关联数据库将数据保存在不同的表中,而不是将所有数据放在一个大仓库内,这样就增加了速度并提高了灵活性.MySQL 软件采用了双授权政策(本词条"授权政策& ...

  3. 《高性能MySql》阅读笔记

    1.查询优化,索引优化和架构优化三者相辅相成.(数据库架构是获得高性能的必要条件,但如果查询设计得不好,即便是最好的架构页无法获得高性能.) 2.查询性能低下的最基本的原因就是访问了太多的数据. 3. ...

  4. iOS 串行网络请求。。。待研究

    nsurlsession 和 nsurlconnection 能实现吗? 手动实现的关键点在哪里? 我这里说的串行网络请求,指的是第一个网络请求不返回数据,第二个网络请求就不能开始. AFNetwor ...

  5. nginx和apache的一些比较

    1.两者所用的驱动模式不同. nginx使用的是epoll的非阻塞模式事件驱动. apache使用的是select的阻塞模式事件驱动. 2.fastcgi和cgi的区别 当用户请求web服务的时候,w ...

  6. linux grep 查找字符串

    2015年8月27日 12:04:58 在当前文件夹查找 public function abc() grep -re 'public function abc\b' . // 可以不加e, 适合函数 ...

  7. 【leetcode】 Unique Path ||(easy)

    Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How m ...

  8. MyBatis之CRUD

    1 mybatis框架介绍 1.1回顾jdbc操作数据库的过程 1.2 mybatis开发步骤 A.提供一个SqlMapperConfig.xml(src目录下),该文件主要配置数据库连接,事务,二级 ...

  9. mac VPN配置

    来自: http://www.eefocus.com/Kevin/blog/11-09/230878_53c71.html RSA的SecurID长的是这个样子滴: Mac里面,可以设置VPN, 方法 ...

  10. 用Python套接字创建HTTP客户与服务器程序

    最近在学习python,网络编程中,python寥寥几句,就可以创建一个服务端和客户端程序: 服务端: import sockets = socket.socket()host = socket.ge ...