UITabBar

简介: UITabBar
#define SYSTABBARITEM(TITLE, INAME, TAG) [[UITabBarItem alloc] initWithTitle:TITLE image:[UIImage imageNamed:INAME] tag:TAG]  
NSMutableArray *tbitems = [NSMutableArray array];
    [tbitems addObject:SYSTABBARITEM(@"农家餐饮", @"chi.png", 0)];
    [tbitems addObject:SYSTABBARITEM(@"风情住宿", @"zhu.png", 1)];
    [tbitems addObject:SYSTABBARITEM(@"旅游购物", @"shop.png", 2)];
    [tbitems addObject:SYSTABBARITEM(@"娱乐休闲", @"play.png", 3)];
    [[tbitems  objectAtIndex:0] setAction:@selector(toolsAction0:)];  //添加按钮事件
    [[tbitems  objectAtIndex:1] setAction:@selector(toolsAction1:)];  //添加按钮事件
    [[tbitems  objectAtIndex:2] setAction:@selector(toolsAction2:)];  //添加按钮事件
    [[tbitems  objectAtIndex:3] setAction:@selector(toolsAction3:)];  //添加按钮事件
    self.m_TabBar.items = tbitems;
    self.m_TabBar.selectedItem = [tbitems  objectAtIndex:0];   //设置默认选中项
相关文章
UITabBarController 获得selecdIndex
UITabBarController 获得selecdIndex
89 0
UINavigationController和UITabBarController合用。
UINavigationController和UITabBarController合用。
81 0
|
容器
(三)UITabBarController和UITabBar的基本用法
(三)UITabBarController和UITabBar的基本用法
339 0
|
数据安全/隐私保护
|
数据安全/隐私保护 iOS开发