UITabBarController

tabBar = [[UITabBarController alloc] init];


    tabBar.delegate = self;


   Page1* blueViewController = [[Page1 alloc] init];


   Page2* yellowViewController = [[Page2 alloc] init];


    NSArray *viewControllerArray = [NSArray arrayWithObjects:blueViewController,yellowViewController,nil];


    tabBar.viewControllers = viewControllerArray;


    tabBar.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);


    [self.view addSubview:tabBar.view];


    [viewControllerArray release];








、、、、、、、、、、、、
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil


{


    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];


    if (self) {


        // Custom initialization


        UITabBarItem *item = [[UITabBarItem alloc] initWithTitle:@"礼品" image:[UIImage imageNamed:@"礼品.png"] tag:1];


        self.tabBarItem = item;


        [item release];


    }


    return self;


}

ios 设置tabbar选中颜色

 [self.tabBarController.tabBar setSelectedImageTintColor:[UIColor greenColor]];

posted @ 2012-12-06 13:37  废弃账号  阅读(120)  评论(0编辑  收藏  举报