- (IBAction)btnClick:(id)sender {

    UITabBarController *tabBarCtrl = [[[UITabBarController alloc] init]autorelease];
UITabBarItem *tabbarItemA = [[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemBookmarks tag:]autorelease]; tabbarItemA.badgeValue = @""; UITabBarItem *tabbarItemB = [[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:]autorelease];
UITabBarItem *tabbarItemC = [[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemHistory tag:]autorelease];
UITabBarItem *tabbarItemD = [[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemDownloads tag:]autorelease];
UITabBarItem *tabbarItemE = [[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemMore tag:]autorelease];
UITabBarItem *tabbarItemF = [[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemSearch tag:]autorelease]; TWFXViewAController *viewA = [[[TWFXViewAController alloc] initWithNibName:@"TWFXViewAController" bundle:nil]autorelease];
viewA.tabBarItem = tabbarItemA; TWFXViewAController *viewB = [[[TWFXViewAController alloc] initWithNibName:@"TWFXViewBController" bundle:nil]autorelease];
viewB.tabBarItem = tabbarItemB; TWFXViewAController *viewC = [[[TWFXViewAController alloc] initWithNibName:@"TWFXViewAController" bundle:nil]autorelease];
viewC.tabBarItem = tabbarItemC; TWFXViewAController *viewD = [[[TWFXViewAController alloc] initWithNibName:@"TWFXViewBController" bundle:nil]autorelease];
viewD.tabBarItem = tabbarItemD; TWFXViewAController *viewE = [[[TWFXViewAController alloc] initWithNibName:@"TWFXViewBController" bundle:nil]autorelease];
viewE.tabBarItem = tabbarItemE; TWFXViewAController *viewF = [[[TWFXViewAController alloc] initWithNibName:@"TWFXViewBController" bundle:nil]autorelease];
viewF.tabBarItem = tabbarItemF; tabBarCtrl.viewControllers = @[viewA,viewB,viewC,viewD,viewE,viewF];
tabBarCtrl.customizableViewControllers =@[viewD,viewE,viewF];
[tabBarCtrl setSelectedIndex:]; [self presentViewController:tabBarCtrl animated:YES completion:nil];
}

iOS 学习之 UITabBarController的更多相关文章

  1. iOS学习之UITabBarController

    一.标签视图控制器——UITabBarController 1.UITabBarController的继承关系: @interface UITabBarController : UIViewContr ...

  2. 2015最新iOS学习线路图

    iOS是由苹果公司开发的移动操作系统,以xcode为主要开发工具,具有简单易用的界面.令人惊叹的功能,以及超强的稳定性,已经成为iPhone.iPad 和iPod touch 的强大基础:iOS 内置 ...

  3. ios 学习路线总结

    学习方法 面对有难度的功能,不要忙着拒绝,而是挑战一下,学习更多知识. 尽量独立解决问题,而不是在遇到问题的第一想法是找人. 多学习别人开源的第三方库,能够开源的库一定有值得学习的地方,多去看别的大神 ...

  4. iOS学习之第二个View使用UITabBarViewController

    前面有一篇博文iOS学习之Tab Bar的使用和视图切换 这是在AppDelegate里使用Tabbar,这样的程序打开就是TabbarView了,有时候我们需要给程序做一些帮助页面,或者登录页面,之 ...

  5. iOS学习笔记-自己动手写RESideMenu

    代码地址如下:http://www.demodashi.com/demo/11683.html 很多app都实现了类似RESideMenu的效果,RESideMenu是Github上面一个stars数 ...

  6. iOS学习-压缩图片(改变图片的宽高)

    压缩图片,图片的大小与我们期望的宽高不一致时,我们可以将其处理为我们想要的宽高. 传入想要修改的图片,以及新的尺寸 -(UIImage*)imageWithImage:(UIImage*)image ...

  7. 【原】iOS学习之事件处理的原理

    在iOS学习23之事件处理中,小编详细的介绍了事件处理,在这里小编叙述一下它的相关原理 1.UITouch对象 在触摸事件的处理方法中都会有一个存放着UITouch对象的集合,这个参数有什么用呢? ( ...

  8. iOS学习笔记——AutoLayout的约束

    iOS学习笔记——AutoLayout约束 之前在开发iOS app时一直以为苹果的布局是绝对布局,在IB中拖拉控件运行或者直接使用代码去调整控件都会发上一些不尽人意的结果,后来发现iOS在引入了Au ...

  9. iOS 怎么设置 UITabBarController 的第n个item为第一响应者?

    iOS 怎么设置 UITabBarController 的第n个item为第一响应者? UITabBarController 里面有个属性:selectedIndex @property(nonato ...

随机推荐

  1. python urllib 和 urllib2

    urllib 和 urllib2 都是接受URL请求的相关模块,但是提供了不同的功能.两个最显著的不同如下: urllib 仅可以接受URL,不能创建 设置了headers 的Request 类实例: ...

  2. azure绑定ssl,godaddy的ssl证书

    域名是godaddy 申请的,证书也是godaddy 购买的,DV证书. godaddy购买证书后,申请ssl,需要输入,csr.网上找的csr生成工具,我使用  https://myssl.com/ ...

  3. shell bash使用,包括判断文件或文件夹是否存在举例

    Linux shell编程——if条件判断 if [ condition ] ;then //一定要注意[] 與裡面的內容要有空格隔开 例如 if [(空格)${a} -eq 3(空格)]; then ...

  4. cocos2d-x 游戏优化方案

    优化的方案: 引擎底层优化.纹理优化.渲染优化.资源缓存.内存优化. 纹理优化: cocos2d-x 底层是OPenGL ES实现的. 对于图案片载入的内存是2的幂次方. 使用的图片是100*128 ...

  5. Android Studio3.0 配置ButterKnife出错的解决

    需要注意的问题: (1)ButterKnife.bind(this);必须在设置布局之后进行初始化: 官方升级到了8.8.1了 compile 'com.jakewharton:butterknife ...

  6. 定位frame中的元素

    场景 处理frame需要用到2个方法,分别是switch_to_frame(name_or_id_or_frame_element)和switch_to_default_content() 如何理解这 ...

  7. 前端基础------JS

    JS中的语句要以分号 ;  为结束符. JS语言基础: 1, JS 的变量名可以使用 下划线, 数字, 字母, $ 组成. 不可以是数字开头 2, 声明变量使用var 变量名. 的格式来进行声明. v ...

  8. java 多种判断key是否在map中存在的方法

    java 中有时候会遇到判断传过来的map里是否包含了指定的key,我目前只发现两种办法,如果有其他方法欢迎补充 我添加上去: HashMap map = new HashMap(); map.put ...

  9. jquery遍历json与数组方法总结

    来自:http://www.php100.com/html/program/jquery/2013/0905/5927.html 先我们来参考each() 方法,each()规定为每个匹配元素规定运行 ...

  10. 类与类之间关系,用C#和JavaScript体现

    前言 在面向对象中,类之间的关系有六种,分别是: 关联关系(Association) 泛化关系(Generalization) 依赖(Dependency) 聚合(Aggregation) 组合(Co ...