UITabBarController

简介: 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]];
相关文章
|
3月前
|
iOS开发 容器
什么是 UINavigationController 和 UITabBarController?它们有什么作用?
什么是 UINavigationController 和 UITabBarController?它们有什么作用?
20 2
UITabBarController 获得selecdIndex
UITabBarController 获得selecdIndex
56 0
UINavigationController和UITabBarController合用。
UINavigationController和UITabBarController合用。
53 0
UINavigationBar-使用总结
UINavigationBar-使用总结
83 0
|
容器
(三)UITabBarController和UITabBar的基本用法
(三)UITabBarController和UITabBar的基本用法
265 0