Tuesday, 16 October 2012

Customising the tab bar before the iOS 5 in iPhone

UIImage *tabBackground = [UIImage imageNamed:@"tb1.png"];
self.tabBarController.tabBar.frame=CGRectMake(0,480,320,49);
    imgV=[[UIImageView alloc] initWithImage:tabBackground];
    imgV.frame=CGRectMake(0, 480, 320, 56);
    [self.tabBarController.view addSubview:imgV];
- (BOOL)tabBarController:(UITabBarController *)tabBarController1 shouldSelectViewController:(UIViewController *)viewController{
  switch (index) {
        case 0:
            self.imgV.image=[UIImage imageNamed:@"tb1.png"];
            break;
        case 1:
            self.imgV.image=[UIImage imageNamed:@"tb2.png"];
            break;
        case 2:
            self.imgV.image=[UIImage imageNamed:@"tb3.png"];
            break;
        case 3:
            self.imgV.image=[UIImage imageNamed:@"tb4.png"];
            break;
        case 4:
            self.imgV.image=[UIImage imageNamed:@"tb5.png"];
            break;
        default:
            break;
    }
    return YES;
}

http://stackoverflow.com/questions/1355480/preventing-a-uitabbar-from-applying-a-gradient-to-its-icon-images

No comments:

Post a Comment