越努力.越幸福.----willingseal.
UINavigationController的结构组成
--------
(1)新建一个工程,创建3个控制器类和3个视图,并关联视图和控制器,设置第一个view为蓝绿色,第二个view为黄色,第三个view为橘色。
(2)
{
self.window = [[UIWindowalloc] initWithFrame:[[UIScreenmainScreen] bounds]];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColorwhiteColor];
ListViewController * listVC= [[ListViewController alloc] initWithNibName:@"List_iphone"bundle:nil];
self.navController = [[UINavigationControlleralloc] initWithRootViewController:listVC];
[self.windowaddSubview:self.navController.view];
[self.windowmakeKeyAndVisible];
returnYES;
}
{
[superviewDidLoad];
// Do any additional setup after loading the view.
self.title = @"列表";
TwoViewController *twoVC = [[TwoViewControlleralloc] initWithNibName:@"Two_iphone"bundle:nil];
[self.navigationControllerpushViewController:twoVCanimated:YES];
{
[superviewDidLoad];
// Do any additional setup after loading the view.
self.title = @"Two";
}
- (IBAction)toTwo:(id)sender {
ThreeViewController *threeVC = [[ThreeViewControlleralloc] initWithNibName:@"Three_iphone"bundle:nil];
[self.navigationControllerpushViewController:threeVC animated:YES];
}