iOS UITabBarController 典型应用

1150阅读 0评论2015-12-03 jeffasdasd
分类:iOS平台

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    // Override point for customization after application launch.

self.tabBarController = [[UITabBarController alloc] init];

DecodeGifViewController *decodeVCtrl = [[ DecodeGifViewController alloc ] initWithStyle:UITableViewStyleGrouped ];

UINavigationController *decodeNaviVCtrl = [[ UINavigationController alloc ] initWithRootViewController:decodeVCtrl ];

decodeVCtrl.title = decodeNaviVCtrl.title = @"Decode";

decodeNaviVCtrl.tabBarItem.image = [ UIImage imageNamed:@"decode.png" ];

decodeNaviVCtrl.navigationBar.barStyle = UIBarStyleBlack;

EncodeViewController *encodeVCtrl = [[ EncodeViewController alloc ] initWithStyle:UITableViewStylePlain ];

UINavigationController *encodeNaviVCtrl = [[ UINavigationController alloc ] initWithRootViewController:encodeVCtrl ];

encodeVCtrl.title = encodeNaviVCtrl.title = @"Encode";

encodeNaviVCtrl.tabBarItem.image = [ UIImage imageNamed:@"encode.png" ];

encodeNaviVCtrl.navigationBar.barStyle = UIBarStyleBlack;

self.tabBarController.viewControllers = [NSArray arrayWithObjects:decodeNaviVCtrl, encodeNaviVCtrl, nil];

self.window.rootViewController = self.tabBarController;

    [self.window makeKeyAndVisible];

    return YES;

}

上一篇:iOS 苹果官方Demo合集
下一篇:UINavigationController 跳转到指定 页面