我需要实现一个多视图应用程序,对我来说非常复杂,我需要一些建议。这个多视图应用程序类似于:
第一个视图:普通UIViewController,带有一个按钮,当我按下它时,进入第二个视图
第二个视图(也称为主视图):一个带有选项卡栏的窗口,有2个选项卡项可以在以下视图之间进行切换:
第二个视图A:普通UIViewController,带有一些元素
第二个视图B:UITableViewController
有人能给我一些建议,从哪里开始阅读或提供一些示例吗?
谢谢
SecondViewController *screen = [[SecondViewController alloc] initWithNibName:nil bundle:nil];
screen.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:screen animated:YES];
[screen release];
希望这能有所帮助,再见。
Appdelegate.h
UITabBarController *tabBarController;
// 设置属性
Appdelegate.m
// 合成
tabBarController = [[UITabBarController alloc] init];
tabBarController.delegate=self;
//Adding Search,Nearby,Map,AboutUs,Favorites Tabs to tabBarController
Search * search = [[Search alloc] init];
UINavigationController *searchNav = [[UINavigationController alloc] initWithRootViewController:search];
Nearby* nearby = [[Nearby alloc] init];
UINavigationController *nearbyNav = [[UINavigationController alloc] initWithRootViewController:nearby];
Map* map = [[Map alloc] init];
UINavigationController *mapNav = [[UINavigationController alloc] initWithRootViewController:map];
AboutUs* aboutUs = [[AboutUs alloc] init];
UINavigationController *aboutUsNav = [[UINavigationController alloc] initWithRootViewController:aboutUs];
Favorites* favorites = [[Favorites alloc] init];
UINavigationController *favoritesNav = [[UINavigationController alloc] initWithRootViewController:favorites];
NSArray* controllers = [NSArray arrayWithObjects:searchNav,nearbyNav,mapNav,aboutUsNav,favoritesNav, nil];
tabBarController.viewControllers = controllers;
[window addSubview:tabBarController.view];