iOS11 自定义tabbar遇到的问题,删除系统自带tabbar按钮
2017-11-13 11:34
288 查看
自定义tabber,就是创建自己的tabbar盖在系统的tabbar上面
//自定义tabbar
GJWTabBar *customTabBar = [[GJWTabBar
alloc] init];
customTabBar.frame =
self.tabBar.bounds;
customTabBar.delegate =
self;
[self.tabBar
addSubview:customTabBar];
self.customTabBar = customTabBar;
//
删除系统自动生成的UITabBarButton
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
// 删除系统自动生成的UITabBarButton
for (UIView *child
in self.tabBar.subviews) {
if ([child
isKindOfClass:[UIControl
class]]) {
[child removeFromSuperview];
}
}
}
可是当我运行时候,系统自带的按钮依然像盖在
上面,出现两个tabbar,之前的ios11以前都没有这个问题的。
后来发现在-(void)viewDidAppear:(BOOL)animated里面重新调用删除系统自带tabbar
就可以了。
//自定义tabbar
GJWTabBar *customTabBar = [[GJWTabBar
alloc] init];
customTabBar.frame =
self.tabBar.bounds;
customTabBar.delegate =
self;
[self.tabBar
addSubview:customTabBar];
self.customTabBar = customTabBar;
//
删除系统自动生成的UITabBarButton
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
// 删除系统自动生成的UITabBarButton
for (UIView *child
in self.tabBar.subviews) {
if ([child
isKindOfClass:[UIControl
class]]) {
[child removeFromSuperview];
}
}
}
可是当我运行时候,系统自带的按钮依然像盖在
上面,出现两个tabbar,之前的ios11以前都没有这个问题的。
后来发现在-(void)viewDidAppear:(BOOL)animated里面重新调用删除系统自带tabbar
就可以了。
相关文章推荐
- Android进阶——自定义View之继承系统控件实现自带删除按钮动画效果和软键盘自动悬浮于文本框下方
- 机房收费系统遇到的问题(一) datagridview一次性移除多行选中数据,同时删除数据库数据
- 自定义返回按钮时,iOS7手势返回遇到的问题
- 利用WIN8自带系统还原功能还原系统,遇到的一些问题及解决思路。
- UITableView 自带编辑删除 自定义按钮
- Android 实现自定义自带删除按钮的EditText(带有搜索接口)
- xcode6.1 自定义tabbar与poptoview产生重叠问题以及ios8上自定义tabbar图片显示颜色是系统颜色问题
- 昨天做项目的时候,遇到了一个tabbar 影响底部按钮的问题
- tabbar 按钮形状自定义显示问题
- 自定义tabBar如何移除系统自带的TabBarItemButton
- UITableView 自带编辑删除 自定义按钮
- 今天又学习了,关于windows和Linux双系统删除Linux遇到的问题。
- Win7下卸载双系统Ubuntu遇到的问题——删除grub引导程序
- UITableView自定义左划删除遇到的问题
- Qt 绘制系统自带的最小化按钮和关闭按钮 及 解决中文乱码问题
- dojo grid遇到的问题 点击按钮“全选”'删除"无法实现
- (二)tablebar自定义按钮,去除系统自带的背景
- iOS11 自定义tabbar图标出现重影问题
- iOS开发学习之利用系统远程UITableView 自定义滑动删除按钮、增加自定义滑动按钮方法
- 删除手机系统文件(遇到权限问题的解决方法)