Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

51 lines (36 sloc) 2.642 kB

NOUSguide Inc.

NGTabBarController

A custom TabBarController which can be positioned on the bottom, top, left or top. Utilizes iOS 5 Containment API if possible, but works on iOS 4 too. The TabBar is fully customizable with a tintColor or background image as well as the possibility to show/hide the item highlight and the possibility to change the text colors, have image-only tabBar items etc.

Usage

NGColoredViewController *vc1 = [[NGColoredViewController alloc] initWithNibName:nil bundle:nil];
NGColoredViewController *vc2 = [[NGColoredViewController alloc] initWithNibName:nil bundle:nil];
NGColoredViewController *vc3 = [[NGColoredViewController alloc] initWithNibName:nil bundle:nil];
NGColoredViewController *vc4 = [[NGColoredViewController alloc] initWithNibName:nil bundle:nil];
NGColoredViewController *vc5 = [[NGColoredViewController alloc] initWithNibName:nil bundle:nil];

vc1.ng_tabBarItem = [NGTabBarItem itemWithTitle:@"Home" image:image1];
vc2.ng_tabBarItem = [NGTabBarItem itemWithTitle:@"Images" image:image2];
vc3.ng_tabBarItem = [NGTabBarItem itemWithTitle:@"Live" image:image3];
vc4.ng_tabBarItem = [NGTabBarItem itemWithTitle:@"Contact" image:image4];
vc5.ng_tabBarItem = [NGTabBarItem itemWithTitle:@"Settings" image:image5];

NSArray *viewController = [NSArray arrayWithObjects:vc1,vc2,vc3,vc4,vc5,nil];

NGTabBarController *tabBarController = [[NGTestTabBarController alloc] initWithDelegate:self];

tabBarController.animation = NGTabBarControllerAnimationMoveAndScale;
tabBarController.layoutStrategy = $isPhone() ? NGTabBarLayoutStrategyEvenlyDistributed : NGTabBarLayoutStrategyCentered;
tabBarController.itemPadding = 10.f;
tabBarController.showsItemHighlight = NO;
tabBarController.tintColor = [UIColor redColor];
tabBarController.viewControllers = viewController;
self.window.rootViewController = tabBarController;

Just have a look at the provided Demo-Application and the header files to see what's possible.

Credits

NGTabBarController was created by Matthias Tretter (@myell0w).

Images

Right Side Left Side

License

NGTabBarController is available under the MIT license. See the LICENSE file for more info. For usage without attribution contact NOUSguide.

Jump to Line
Something went wrong with that request. Please try again.