tabbar小细节
2016-04-17 15:10
351 查看
1.从storyboard得到tabBarItem并对其设置选中等各个状态
建立一个tabbarController并和故事版关联
之后利用得到对用item 对其进行操作
UITabBarItem *item1 = self.tabBar.items[0];
2.得到tabbar
左边图片 右边文字
更改图片和文字位置
vc.tabBarItem.imageInsets =
UIEdgeInsetsMake(5, -30, -5,
30);
//更改字体和位置
[[UITabBarItem
appearance] setTitleTextAttributes:[NSDictionary
dictionaryWithObjectsAndKeys:[UIFont
systemFontOfSize:14],NSFontAttributeName,
nil]
forState:UIControlStateNormal];
[[UITabBarItem
appearance] setTitlePositionAdjustment:UIOffsetMake(15, -15.0)];
3.push另一个界面隐藏 tabbar
在navigation中重写该方法
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
NSLog(@"1111-%ld",self.viewControllers.count
);
if (self.viewControllers.count>0
) {
viewController.hidesBottomBarWhenPushed =
YES;
}
[super
pushViewController:viewController
animated:animated];
}
建立一个tabbarController并和故事版关联
之后利用得到对用item 对其进行操作
UITabBarItem *item1 = self.tabBar.items[0];
2.得到tabbar
左边图片 右边文字
更改图片和文字位置
vc.tabBarItem.imageInsets =
UIEdgeInsetsMake(5, -30, -5,
30);
//更改字体和位置
[[UITabBarItem
appearance] setTitleTextAttributes:[NSDictionary
dictionaryWithObjectsAndKeys:[UIFont
systemFontOfSize:14],NSFontAttributeName,
nil]
forState:UIControlStateNormal];
[[UITabBarItem
appearance] setTitlePositionAdjustment:UIOffsetMake(15, -15.0)];
3.push另一个界面隐藏 tabbar
在navigation中重写该方法
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
NSLog(@"1111-%ld",self.viewControllers.count
);
if (self.viewControllers.count>0
) {
viewController.hidesBottomBarWhenPushed =
YES;
}
[super
pushViewController:viewController
animated:animated];
}
相关文章推荐
- Android性能优化-MAT工具的简单使用
- Cypress固件架构彻底解析及USB枚举
- PLC梯形图编程练习
- android客户端学习-事件监听的三种实现方式
- 大型网站技术架构 核心原理与案例分析 2016-4-17
- 滑动窗口的最大值
- 收集的MySQL的面试题分享给大家
- jquery_lazyload插件
- EntityFramework6 快速入门教程
- 关于lua的#
- 时间序列分析
- 如果看了这篇文章还不懂卷积,那就过来掐死我吧
- (2.2.6.2)构建工具Ant(一)—入门
- 基于MATLAB的QPSK通信系统
- js实现鼠标监听
- JS中取二维数组中最大值的方法汇总
- Error running Tomcat8: Address localhost:1099 is already in use
- 排序命令: sort,uniq,wc
- hdu 1031 Design T-Shirt
- Oracle--触发器