Ios tab Bar 使用方法

时间:2014-10-23 18:57:21   收藏:0   阅读:295

http://blog.sina.com.cn/s/blog_63578f140100w56m.html

UITabBar* tabBar = [[UITabBar alloc] initWithFrame:CGRectMake(40,0.0,240,30)];

    [mainView addSubview:tabBar];

    [tabBar release];

    

    UITabBarItem *tabBarItem1 = [[UITabBarItem alloc] initWithTitle:@"排队人数" image:nil tag:0];

    UITabBarItem * tabBarItem2 = [[UITabBarItem alloc] initWithTitle:@"人均" image:nil tag:1];

    UITabBarItem * tabBarItem3 = [[UITabBarItem alloc] initWithTitle:@"距离" image:nil tag:2];

    UITabBarItem * tabBarItem4 = [[UITabBarItem alloc] initWithTitle:@"好评" image:nil tag:3];

    NSArray *tabBarItemArray = [[NSArray alloc] initWithObjects: tabBarItem1, tabBarItem2, tabBarItem3, tabBarItem4,nil];

    [tabBar setItems: tabBarItemArray];

    [tabBarItemArray release];

 

    好像tabBar.backgroundColor = [UIColor blueColor];设置背景不起作用

    alpha可以起作用

原文:http://www.cnblogs.com/wcLT/p/4046527.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!