在StoryBoard已画TabbarItem的情况下 代码手动添加TabBarItem
来源:互联网 发布:淘宝化妆品店铺介绍 编辑:程序博客网 时间:2024/06/07 00:45
如图
手动添加一个新的TabBarItem
话不多说 上代码
//添加账户管理ViewController-(void)addNewAccountVC{ //alloc 一个控制器 _newACC = [[NewMyAccountViewController alloc] init]; UINavigationController *newAccNav = [[UINavigationController alloc] initWithRootViewController:_newACC];//添加控制器 [self.tabBarControl addChildViewController:newAccNav]; //设置普通状态 以及 按下的 图片 UIImage *image3 = [UIImage imageNamed:@"tab_account_normal"]; UIImage *image3Select = [UIImage imageNamed:@"tab_account_press"]; //开始新建一个item按钮 因为我们已经用StoryBoard画了两个ITem 所以这里的tag 就填 2! newAccNav.tabBarItem = [[UITabBarItem alloc] initWithTitle:nil image:image3 tag:2]; newAccNav.tabBarItem.selectedImage = image3Select; //调整item的图片位置! newAccNav.tabBarItem.imageInsets = UIEdgeInsetsMake(6, 0, -6, 0);}
这里还有个讲解 self.title 和 self.navigation.title 区别的 , 正好同一个例子 ,一起写上了
http://blog.csdn.net/iostiannan/article/details/50997626
0 0
- 在StoryBoard已画TabbarItem的情况下 代码手动添加TabBarItem
- Storyboard中添加tabbaritem,默认创建时候两个
- storyboard tabBarItem 添加image和字体颜色问题
- 给 tabBarItem 添加小红点
- 设置morenavigationcontroller的tabbaritem
- tabbaritem的问题
- 给系统的UITabbarViewController 的tabBarItem 添加图片的问题
- tabbar代码加载。设置tabbaritem的title和image
- 调整tabbarItem字体的大小
- tabbaritem的字体颜色设置
- 设置tabBarItem的图片渲染
- tabBarItem的选中抖动效果
- 自定义TabBarItem
- uitabbarcontroller上的tabbaritem的图片设置
- ios uitabbarcontroller 双击tabbaritem ,popToRootViewController的问题
- IOS7 tabBarItem 自定义图片的设置
- 点击tabbarItem变Item的背景色
- IOS7 tabBarItem 自定义图片的设置
- Android layout(int ,int,int,int)四个参数含义
- alamofire GET请求带中文参数遇到的问题
- ubuntu下安装maven
- SpatialHadoop实例:面向空间数据的高效MapReduce框架
- 网络协议系列之四:IGMP、ICMP和ARP
- 在StoryBoard已画TabbarItem的情况下 代码手动添加TabBarItem
- Android 5.1 以太网服务启动过程
- POJ3322 Bloxorz I(BFS)
- OpenCV 2.4.12 GPU编译及使用
- tar error:"Error exit delayed from previous errors"的几种解决办法
- qrcode生成二维码,canvas转化为图片
- Redis-3.0.7主从配置
- SAP基本计量单位更改
- Oracle 之 SQL 面试题 录