开发者

Custom Tab Bar Views in iPhone

开发者 https://www.devze.com 2023-04-02 19:04 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号