1、/**
iOS7 view的frame: (0,0,320,480)
iOS6 view的frame: (0,0,320,411) 从状态栏下方开始计算坐标
UITabBar高度是49
*/
2、// 第一种方式
CZOneViewController *one = [[CZOneViewController alloc] init];
one.title = @"第一个";
// 设置图像
one.tabBarItem.image = [UIImage imageNamed:@"tab_buddy_nor"];
// 设置数字
one.tabBarItem.badgeValue = @"100";
CZTwoViewController *two = [[CZTwoViewController alloc] init];
two.tabBarItem.image = [UIImage imageNamed:@"tab_me_nor"];
two.title = @"第二个";
// [tab addChildViewController:one];
// [tab addChildViewController:two];
tab.viewControllers = @[one, two];
时间: 2024-10-05 20:10:45