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

Implementing Navigation with UINavigationController

时间:2014-10-26 11:29:13      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   io   ar   strong   sp   div   

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.

bubuko.com,布布扣

这个是详情页面

bubuko.com,布布扣

 

Implementing Navigation with UINavigationController

标签:style   blog   http   color   io   ar   strong   sp   div   

原文地址:http://www.cnblogs.com/bnbqian/p/4051724.html

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