iOS隐藏和显示tabBar
ios 显示 隐藏 tabBar
2023-09-11 14:14:25 时间
方案1:
使用self.tabBarController.tabBar.hidden来控制当前页面tabBar的显示和隐藏
self.tabBarController.tabBar.hidden = YES;
方案2:
使用hidesBottomBarWhenPushed来控制push出来页面tabBar的显示和隐藏
UIViewController *ctrl = [[UIViewController alloc] init];
ctrl.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController: ctrl animated:YES];
问题:UITabBarController从根页面push到下级页面后,确认下级页面的hidesBottomBarWhenPushed已经设置为YES,当下级页面的输入框收起键盘时,tabBar会再次出现。
解决方案1:(iOS12)
[[UITabBar appearance] setTranslucent:NO];
解决方案2:
当使用self.tabBarController.tabBar.hidden后,再调用hidesBottomBarWhenPushed,push出来的页面键盘隐藏时tabBar会再次出现,避免同时使用这两种隐藏tabbar的方案。
相关文章
- iOS开发之网络编程--使用NSURLConnection实现大文件下载
- IOS 归档 即序列化与反序列化
- ios播放系统自带音效以及震动
- iOS开发UI篇—IOS开发中Xcode的一些使用技巧
- iOS开发UI篇—ios应用数据存储方式(偏好设置)
- android仿ios开关按钮
- iOS时间显示今天昨天
- IOS代码运行的磨刀石-预编译指令
- iOS swift 设置UIButton字体大小
- iOS oc swift 通知的简单使用
- iOS swift 输入密码(不显示)
- iOS swift cell.detailTextLabel为nil(系统的cell) UITableViewCell 无法显示detailTextLabel.text
- Discovering services for peripheral while delegate is either nil or does not implement(ios蓝牙)
- ios本地存储(swift版)查看真机沙盒 归解档 本地数据持久化
- ios性能优化
- ios 仿新浪微博 UINavigationController 向左滑动时显示上一个控制器的View.
- iOS的图表显示的实现
- ios说说自己的计划是什么样的发展论坛
- ios之TableViewCell重用机制避免反复显示问题
- iOS 内存管理