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.

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

如下图所示,我们得到了一个能够跳转的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. javascript最容易混淆的作用域、提升、闭包

    一.函数作用域 1.函数作用域 就是作用域在一个“Function”里,属于这个函数的全部变量都可以在整个函数的范围内使用及复用. function foo(a) { var b = 2; funct ...

  2. python 正则表达式点号与'\n'符号的问题

    遇到了一个小虫,特记录之. 1.正则表达式及英文的处理如下: >>> import re >>> b='adfasdfasf<1safadsaf>23w ...

  3. linux下git安装

    Download for Linux and Unix It is easiest to install Git on Linux using the preferred package manage ...

  4. webrtc开源项目音频重采样“不友好接口”的几点总结

    WebRTC(Web Real Time Communication)并不是Google原来自己的技术,在2010年,Google以大约6820万美元收购了VoIP软件 开发商Global IP So ...

  5. phpcms前台退出登录的时候提示信息'退出成功0'

    问题背景: phpcms前台退出登录的时候,提示了一个退出成功0 让我很困惑为啥有个0呢? 问题分析: 进入 ./phpcms/modules/member/index.php 找到logout方法, ...

  6. C语言中#define的用法(转)

    转自:http://www.dingge.com/main/article.asp?id=10 今天整理了一些#define的用法,与大家共享! 1.简单的define定义 #define MAXTI ...

  7. UIView的一些基本方法 init、loadView、viewDidLoad、viewDidUnload、dealloc

    init方法 在init方法中实例化必要的对象(遵从LazyLoad思想) ‍init方法中初始化ViewController本身 loadView方法 当view需要被展示而它却是nil时,view ...

  8. FFPlay-noConsole-ver-20160409-snapshot

    ESC 退出 0 进度条开关 1 屏幕原始大小 2 屏幕1/2大小 3 屏幕1/3大小 4 屏幕1/4大小 S 下一帧 [ -2秒 ] +2秒 ; -1秒 ' +1秒 下一个帧 -> -5秒 F ...

  9. Java for LeetCode 228 Summary Ranges

    Given a sorted integer array without duplicates, return the summary of its ranges. For example, give ...

  10. 配置tomcat的虚拟路径

    配置tomcat的虚拟路径有两个地方需要配置,以eclipse为例: ①在tomcat的server.xml中的host节点内添加 <Context path="/meims/user ...