标签栏视图控制器是容器视图控制器的一种,每个界面都有一个视图控制器,可以是UIviewcontroller,UI tableviewcontroller等基本视图控制器。
例子:
定义musiclist按钮及界面(tableview controller):
- (id)initWithStyle:(UITableViewStyle)style{
<span style="font-size:18px;"> self = [super initWithStyle:style];
if (self) {
self.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"MusicList" image:[UIImage imageNamed:@"Unlock"] tag:0];//根据tabbaritem设置按钮图片及按钮底部文本
}
return self;
}
</span>
<span style="font-size:18px;">- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{