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 ...
随机推荐
- 一个简单的servlet容器
[0]README 0.1)本文部分文字转自 “深入剖析Tomcat”,旨在学习 一个简单的servlet容器 的基础知识: 0.2)for complete source code, pleas ...
- diamond源码阅读-diamond-server
diamond-server 1 增加一条数据 /diamond-server/admin.do?method=postConfig 1.1 调用 this.configService.addConf ...
- 数据库 : Mysql - 日常应用
#登录MYSQL数据库 MYSQL -u root -p #显示所有数据库 SHOW databases; #显示当前数据库与应用程序间进行了多少条连接 SHOW processlist; #使用某一 ...
- 微信小程序 快键键
快捷键 格式调整 - Ctrl+S:保存文件 - Ctrl+[, Ctrl+]:代码行缩进 - Ctrl+Shift+[, Ctrl+Shift+]:折叠打开代码块 - Ctrl+C Ctrl+V:复 ...
- css 使图片紧贴底部显示
img{ display: table-cell; vertical-align: bottom; }
- css 变手
用css 添加手状样式,鼠标移上去变小手,变小手 用css 添加手状样式,鼠标移上去变小手,变小手 cursor:pointer; 用JS使鼠标变小手onmouseover(鼠标越过的时候) onmo ...
- Python自然语言处理实践: 在NLTK中使用斯坦福中文分词器
http://www.52nlp.cn/python%E8%87%AA%E7%84%B6%E8%AF%AD%E8%A8%80%E5%A4%84%E7%90%86%E5%AE%9E%E8%B7%B5-% ...
- tsinsen A1333. 矩阵乘法(梁 盾)
A1333. 矩阵乘法(梁 盾) 时间限制:2.0s 内存限制:256.0MB 总提交次数:515 AC次数:211 平均分:54.14 将本题分享到: 查看未格式化 ...
- 使用Nexus管理Maven仓库时,上传带依赖的第三方jar
总所周知,使用Maven构建非常方便.在企业中使用Nexus创建私服来管理Maven时,需要上传很多没有开放源码的第三方Jar包.本文将讲述当第三方Jar包有很多并且互相有依赖时如何上传. 核心操作 ...
- JS HTML DOM 事件对象(onclick、onmouseenter)
HTML DOM 事件允许Javascript在HTML文档元素中注册不同事件处理程序. 事件通常与函数结合使用,函数不会在事件发生前被执行! (如用户点击按钮). HTML DOM 事件 DOM: ...