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可以起作用
iOS UITabBar使用方法及问题
博客介绍了iOS中UITabBar的使用方法,包括创建UITabBar、添加到视图、创建UITabBarItem并设置到UITabBar等操作。同时提到设置UITabBar背景颜色可能不起作用,但设置alpha值可以生效。

2536

被折叠的 条评论
为什么被折叠?



