iOS 学习之 UITabBarController
- (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的更多相关文章
- iOS学习之UITabBarController
一.标签视图控制器——UITabBarController 1.UITabBarController的继承关系: @interface UITabBarController : UIViewContr ...
- 2015最新iOS学习线路图
iOS是由苹果公司开发的移动操作系统,以xcode为主要开发工具,具有简单易用的界面.令人惊叹的功能,以及超强的稳定性,已经成为iPhone.iPad 和iPod touch 的强大基础:iOS 内置 ...
- ios 学习路线总结
学习方法 面对有难度的功能,不要忙着拒绝,而是挑战一下,学习更多知识. 尽量独立解决问题,而不是在遇到问题的第一想法是找人. 多学习别人开源的第三方库,能够开源的库一定有值得学习的地方,多去看别的大神 ...
- iOS学习之第二个View使用UITabBarViewController
前面有一篇博文iOS学习之Tab Bar的使用和视图切换 这是在AppDelegate里使用Tabbar,这样的程序打开就是TabbarView了,有时候我们需要给程序做一些帮助页面,或者登录页面,之 ...
- iOS学习笔记-自己动手写RESideMenu
代码地址如下:http://www.demodashi.com/demo/11683.html 很多app都实现了类似RESideMenu的效果,RESideMenu是Github上面一个stars数 ...
- iOS学习-压缩图片(改变图片的宽高)
压缩图片,图片的大小与我们期望的宽高不一致时,我们可以将其处理为我们想要的宽高. 传入想要修改的图片,以及新的尺寸 -(UIImage*)imageWithImage:(UIImage*)image ...
- 【原】iOS学习之事件处理的原理
在iOS学习23之事件处理中,小编详细的介绍了事件处理,在这里小编叙述一下它的相关原理 1.UITouch对象 在触摸事件的处理方法中都会有一个存放着UITouch对象的集合,这个参数有什么用呢? ( ...
- iOS学习笔记——AutoLayout的约束
iOS学习笔记——AutoLayout约束 之前在开发iOS app时一直以为苹果的布局是绝对布局,在IB中拖拉控件运行或者直接使用代码去调整控件都会发上一些不尽人意的结果,后来发现iOS在引入了Au ...
- iOS 怎么设置 UITabBarController 的第n个item为第一响应者?
iOS 怎么设置 UITabBarController 的第n个item为第一响应者? UITabBarController 里面有个属性:selectedIndex @property(nonato ...
随机推荐
- oracle定时job
转载自:http://www.cnblogs.com/hoojo/p/oracle_procedure_job_interval.html Oracle job procedure 存储过程定时任务 ...
- CodeForces 213 E
/* 线段树 + hash: 首先我们可以知道A序列是1~n的排列,那么我们可以先在B序列中把1~n的排列找出来,看其相对位置是否与A相同(hash可做),相同即表明存在一个d满足条件. 以此类推,我 ...
- hdu 4419 线段树 扫描线 离散化 矩形面积
//离散化 + 扫描线 + 线段树 //这个线段树跟平常不太一样的地方在于记录了区间两个信息,len[i]表示颜色为i的被覆盖的长度为len[i], num[i]表示颜色i 『完全』覆盖了该区间几层. ...
- poj2420(模拟退火大法好)
// // main.cpp // poj2420 // // Created by 陈加寿 on 16/2/13. // Copyright © 2016年 chenhuan001. All rig ...
- C#实体类序列化为XML
这两天,应要求做一个C/S的小程序,考虑到程序简洁小巧,存数据的方式不使用数据库,而是直接存入XML文档中保存.为了把复杂实体类里面的属性存入XML,我们可以使用C#有的反射机制,做一个简单的通用工具 ...
- Avoiding Full Table Scans
w MySQL :: MySQL 5.7 Reference Manual :: 9.2.1.19 Avoiding Full Table Scanshttps://dev.mysql.com/doc ...
- 【25】session练习
#用登录练习session html1为首页,html2为登录页面 def session1(request): uname=request.session.get('myname','请登录') # ...
- 让phpstorm 支持 vue文件并且语法高亮
1 安装 vue.js 插件 很遗憾,我的win版本没有支持的插件 2 修改文件类型 vue本质上还是html文件,包含了css html js,用html类型文件打开就可以 给html 文件添加 * ...
- Ubuntu部署jmeter
一:ubuntu部署jdk 1:先下载jdk-8u74-linux-x64.tar.gz,上传到服务器,这里上传文件用到了ubuntu 下的 lrzsz. ubuntu下直接执行 sudo apt-g ...
- 001-Java®语言规范、Java平台标准版文档、JVM概述
一.概述 相关api地址:JDK10 JDK 9 JDK 8 JDK 7 JDK 6 Java语言和虚拟机规范: https://docs.oracle.com/javase/spec ...