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 tab Bar 使用方法的更多相关文章

  1. iOS第八课——Navigation Controller和Tab bar Controller

    今天我们要学习Navigation Controller和Tab bar Controller. Navigation Controller是iOS编程中比较常用的一种容器,用来管理多个视图控制器. ...

  2. iOS开发:使用Tab Bar切换视图

    iOS开发:使用Tab Bar切换视图 上一篇文章提到了多视图程序中各个视图之间的切换,用的Tool Bar,说白了还是根据触发事件使用代码改变Root View Controller中的Conten ...

  3. iOS开发中的错误整理,Changing the delegate of a tab bar managed by a tab bar controller is not allowed

    iOS [错误:'Changing the delegate of a tab bar managed by a tab bar controller is not allowed.'] 错误:'Ch ...

  4. IOS学习之基于IOS7的tab bar

    转载请注明出处 http://blog.csdn.net/pony_maggie/article/details/28129473 作者:小马 什么是tabbar? 先几张图:      上图中蓝色框 ...

  5. Tab Bar Controller和Navigation Controller混合使用详细教程

    在IPHONE上,NAV和TAB混合使用的案例很多.但很多书籍都没详细介绍这个是怎么使用的.我也找了很久才弄清楚怎么做.现在分享给大家. 1.先建立一个Window-based Application ...

  6. iOS中的过期方法和新的替代方法

    关于iOS中的过期方法和新的替代方法 1.获取某些类的UINavigationBar的统一外观并设置UINavigationbar的背景 注:方法名改了但是基本使用方法不变 + (instancety ...

  7. uitabbarcontroller中 在设置tab bar item的image属性后不显示问题

    开始使用ios中的UITabBarController,在给Tab Bar Item设置自定义图片的时候,遇到了问题 按照如下配置: 出来的结果确是: 实际上test24.png应该是: 纠结了很久, ...

  8. iOS UISearchController 的使用方法

    iOS UISearchController 的使用方法 UISearchController 让用户在 UISearchBar 上输入搜索关键词,展示搜索结果或者进行其他操作.UISearchCon ...

  9. 学习笔记:Tab Bar 控件使用详解

    注意这里是:Tab Bar 不是Tab Bar Controller. Tab bar是继承UIView,所以可以添加到ViewController里.是View就可以add到另一个View上去.Ta ...

随机推荐

  1. backbone collection add 事件回调参数

    this.listenTo(this.collection, 'add', this.renderBook); renderBook: function (item) { var bookView = ...

  2. Leeo 智能夜灯:默默守护你的家

    http://www.ifanr.com/462377 Leeo 智能夜灯是一个低调的设备.它不需要你与之交互,也不会产生多余的费用.当你把它插到墙上插座,然后下载应用后,就不用再管它了.然后,它就开 ...

  3. iOS中Cell高度如何能够自动适应需要显示的内容

    本文的代码例子 : "Cell行高自适应.zip" http://vdisk.weibo.com/s/Gb9Mt 下面我们来看看代码.我需要一个第三方库EGO异步下载.addtio ...

  4. IOS开发经验分享

    一些IOS开发的心得: 1) [Multiple Threads] IOS多线程注意, 所有的UI操作都必须在主线程上: Any code that will update the UI should ...

  5. How to install DIG dns tool on windows 7

    This guide explain how to install dig dns tool on windows 7 in few steps: 1. First go to http://www. ...

  6. 敏捷开发之道(四)Scrum概述

    上次的博文敏捷开发之道(二)极限编程XP和敏捷开发之道(三)极限编程XP续中,我们介绍了一下敏捷开发中的XP开发方法,今天咱们来了解另一个比较流行的敏捷开发方法--Scrum. 1.Scrum简介 S ...

  7. Ha ha lou!

    忙了一个晚上,终于稍微把这个模板修缮好了一点=-=//,然而我并不知道怎么像别的大牛一样,博客跟自己做的页面一样.总之今天就先到这里啦! 我的QQ是270115270,不知道会不会有人来呢=-=. ( ...

  8. 怎样在cmd(命令提示符)下进行复制粘贴操作

    如右图,右键命令提示符窗口的标题栏,选择属性.     选择“编辑选项”里的“快速编辑模式”,并确定之:   在弹出的应用选择提示框上选择“保存属性,供以后具有相同标题的窗口使用”:   如此你就可以 ...

  9. Daily Scrum 11.9

    摘要:本次的meeting主要是继续讨论程序的问题以及单元测试和集成测试等,本次为1.01版本.本次的Task列表如下: Task列表 出席人员 Today's Task Tomorrow's Tas ...

  10. DB天气app冲刺二阶段第六天

    今天干了一件让我有点小激动的事情 就是我感觉我貌似找到了为什么我的项目会闪退了有的时候..但是还不确定.等会会再试试看看到底对不对.好吧其实今天就干了这些事整整一下午调试,找bug,决定从头开始一点一 ...