Custom Tab Bar Views in iPhone
I have followed this tutorial here.
I have had no problems doing the tab bar but I cant work out how to get the buttons to open up a view or a nib file.
Please could someone give some advice?
The code I have added below:
ViewController.m
- (void)viewDidLoad
{
[super viewDidLoad];
self.viewControllers = [NSArray arrayWithObjects:
[self viewControllerWithTabTitle:@"Friends" image:[UIImage imageNamed:@"112-group.png"]],
[self viewControllerWithTabTitle:@"Challenges" image:[UIImage imageNamed:@"29-heart.png"]],
[self viewControllerWithTabTitle:@"Create" image:nil],
开发者_运维技巧 [self viewControllerWithTabTitle:@"My Photos" image:[UIImage imageNamed:@"news.png"]],
[self viewControllerWithTabTitle:@"Profile" image:[UIImage imageNamed:@"123-id-card.png"]], nil];
[self addCenterButtonWithImage:[UIImage imageNamed:@"cameraTabBarItem.png"] highlightImage:nil];
}
I hope this helps, I am new to this and its had me confused for a while now.
Thanks
Mike
The UITabBarController (being a container view controller) has an NSArray of viewControllers. You can set these either in code or in the NIB file where you instantiate it.
精彩评论