移除tabBar 重影
-(void)viewWillLayoutSubviews{
[super viewWillLayoutSubviews];
for (UIView *child in self.tabBar.subviews) {
if ([child isKindOfClass:NSClassFromString(@"UITabBarButton")]) {
[child removeFromSuperview];
}
}
}
@interface BaseNavigationController ()
//<UINavigationControllerDelegate>
@end
@implementation BaseNavigationController
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationBar.translucent = NO;
self.automaticallyAdjustsScrollViewInsets = NO;
self.navigationBar.barTintColor = JRGBCOLOR(245, 246, 247); //设置导航栏字体样式
self.navigationBar.tintColor = JRGB(0xa4a4a4);
[self.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:17.0f],NSForegroundColorAttributeName:[UIColor blackColor]}];
// self.delegate = self;
}
- (void)pushViewController:(UIViewController *)viewController
animated:(BOOL)animated
{
if (self.viewControllers.count > 0) {
viewController.hidesBottomBarWhenPushed = YES;
}
[super pushViewController:viewController animated:animated];
}
//- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
//{
// // 删除系统自带的tabBarButton
// for (UIView *tabBar in self.tabBarController.tabBar.subviews) {
// if ([tabBar isKindOfClass:NSClassFromString(@"UITabBarButton")]) {
// [tabBar removeFromSuperview];
// }
// }
//}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
移除tabBar 重影的更多相关文章
- iOS11自定义tabBar重影问题
转载自:(主链接)https://www.jianshu.com/p/1be90349fdb4 https://www.cnblogs.com/coderYu/p/5859638.html 很实用,有 ...
- iOS系统tabbar图标出现重影问题
大家在自定义tabbar的时候会将系统的tabbar干掉,然后放上自已自定义的tabbar(含有想要的Button)对不对,具体代码如下: /** * 添加自定义的tabBar */ -(void)a ...
- iOS开发之——巧用反射机制
1.应用场景——自定义UITabBarController的TabBar视图 (1)隐藏TabBar视图 一般我们选择自定义TabBar视图有两种方式.1是将tabBar视图隐藏;2是将TabBar视 ...
- 小程序API
基础: wx.canIUse(string) boolean wx.canIUse(string schema) 判断小程序的API,回调,参数,组件等是否在当前版本可用. 参数说明 ${A ...
- 微信小程序 API 界面(1)
界面 有关屏幕的api 交互: wx.showToast() 显示消息提示框 参数:object object的属性: title:类型 字符串 提示的内容(文本最多7个汉字) icon:类型 字符串 ...
- 自定义tabBar
★★★★自定义tabBar★★★★★★★ Demo下载地址:https://github.com/marlonxlj/tabBarCustom.git 前言: 有的时候需求要对tabBar进行自定义的 ...
- iOS 切换首页-更改tabbar的容器控制器
最近想到的一个小需求: 首页切换:点击一个切换按钮,能实现首页的风格.排版等变换,原理是用一个新的VC替换掉. 效果如下: ====>====> 实现方式很简单: 以我的Demo为例, ...
- iOS tabbar 自定义小红点 消息显示,定制边框、颜色、高宽
一般我们需要显示消息数,会利用到系统提供的api UIApplication.sharedApplication().applicationIconBadgeNumber = 10 但如果我们不想显示 ...
- 完全自定义 TabBar
// // CustomTabBarController.h // Dream // // Created by mac on 14-10-17. // Copyright (c) 2014年 HM. ...
随机推荐
- ubuntu安装GraphicsMagick
一. sudo apt-get install graphicsmagick 二. http://www.cnblogs.com/cocowool/archive/2010/08/16/1800954 ...
- Windows下安装Mycat
Mycat 首先在安装Mycat之前,需要安装JDK1.7以上,可以在cmd环境下输入 java -version 查看本地安装的java版本 如果未安装或者版本在1.7以下,请重新安装. 安装JDK ...
- jsonp应用
1.服务端jsonp格式数据 如客户想访问 : http://www.runoob.com/try/ajax/jsonp.php?jsonp=callbackFunction. 假设客户期望返回JSO ...
- 51Nod-1586-约数和
#include <cstdio> using namespace std; typedef long long ll; ; int n, q; int cnt[MAXN]; ll a[M ...
- bzoj1575 [Usaco2009 Jan]气象牛Baric
传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1575 [题解] 动态规划,令f[i,j]表示前i个选了j个,且第i个必选的最小值. 转移就枚 ...
- 分布式缓存Memcache
Memcached是分布式的,也就是说它不是本地的.它基于网络连接(当然它也可以使用localhost)方式完成服务,本身它是一个独立于应用的程序或守护进程(Daemon方式). Memcached使 ...
- [bzoj4516][Sdoi2016]生成魔咒——后缀自动机
Brief Description 魔咒串由许多魔咒字符组成,魔咒字符可以用数字表示.例如可以将魔咒字符 1.2 拼凑起来形成一个魔咒串 [1,2]. 一个魔咒串 S 的非空字串被称为魔咒串 S 的生 ...
- mysql五:数据操作
一 介绍 MySQL数据操作: DML ======================================================== 在MySQL管理软件中,可以通过SQL语句中的 ...
- Linux下查看使用的是哪种shell的方法汇总【转】
转自:http://www.jb51.net/LINUXjishu/247797.html 查看当前发行版可以使用的shell 复制代码 代码如下: [root@localhost ~]$ cat / ...
- strcpy函数的实现【转】
转自:http://www.cnblogs.com/chenyg32/p/3739564.html 已知strcpy函数的原型是: char *strcpy(char *dst, const char ...