Created
August 26, 2013 08:30
-
-
Save xdream86/6339218 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view. | |
// 拼车族导航 | |
CarSharingViewController* carSharingViewController = [[CarSharingViewController alloc] init]; | |
UINavigationController* mainNav = [[UINavigationController alloc] initWithRootViewController:carSharingViewController]; | |
UIImage *image = [UIImage imageNamed:@"CarSharingNavBG.png"]; | |
[mainNav.navigationBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault]; | |
// 立即用车导航 | |
UIImage *navBarImage = [UIImage imageNamed:@"nav-bar.png"]; | |
getTaxiHistoryViewController* immediateUseViewController = [[getTaxiHistoryViewController alloc] init]; | |
UINavigationController* immediateCarNav = [[UINavigationController alloc] initWithRootViewController:immediateUseViewController]; | |
[immediateCarNav.navigationBar setBackgroundImage:navBarImage forBarMetrics:UIBarMetricsDefault]; | |
// 预定用车导航 | |
orderHistoryViewController* reservedTaxiViewController = [[orderHistoryViewController alloc] init]; | |
UINavigationController* reservedTaxiNav = [[UINavigationController alloc] initWithRootViewController:reservedTaxiViewController]; | |
[reservedTaxiNav.navigationBar setBackgroundImage:navBarImage forBarMetrics:UIBarMetricsDefault]; | |
// 我的订单导航 | |
PassengerOrderCenterViewController* myOrderViewController = [PassengerOrderCenterViewController defaultInfoCenter]; | |
MyNavController* myOrderNav = [[MyNavController alloc] initWithRootViewController:myOrderViewController]; | |
[myOrderNav.navigationBar setBackgroundImage:navBarImage forBarMetrics:UIBarMetricsDefault]; | |
// 设置导航 | |
SetViewController* settingViewController = [[SetViewController alloc] init]; | |
UINavigationController* settingNav = [[UINavigationController alloc] initWithRootViewController:settingViewController]; | |
[settingNav.navigationBar setBackgroundImage:navBarImage forBarMetrics:UIBarMetricsDefault]; | |
self.delegate = self; | |
self.viewControllers = [[NSArray alloc] initWithObjects:mainNav, immediateCarNav, reservedTaxiNav, myOrderNav, settingNav, nil]; | |
self.tabBar.backgroundImage = [UIImage imageNamed:@"tabbarBG.png"]; | |
self.tabBar.selectionIndicatorImage = [UIImage imageNamed:@"selectedItem.png"]; | |
[[UITabBarItem appearance] setTitleTextAttributes:@{ UITextAttributeTextColor : COLOR(32, 149, 188) } | |
forState:UIControlStateSelected]; | |
} | |
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item { | |
if (item == [tabBar.items objectAtIndex:3]) { | |
[[PassengerOrderCenterViewController defaultInfoCenter] clearAllAlert]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment