UITabbarController & UITabbar 学习
最后更新2016-04-06
一、 UITabbarController
- 给UITabbarController 设置viewControllers熟悉时候,超过五个就会有一个 moreNavigationController;
调用 UITabbarController 的 addChildViewController 可以给系统设置,但是超过五个之后就不显示了;
调用顺序
UITabbarController 进去会调用三次 tabBarControllerSupportedInterfaceOrientations
2017-04-06 09:54:10.594 UITabbarSimpleDemo[986:30480] -[ViewController tabBarControllerSupportedInterfaceOrientations:]
2017-04-06 09:54:10.595 UITabbarSimpleDemo[986:30480] -[ViewController tabBarControllerSupportedInterfaceOrientations:]
2017-04-06 09:54:10.595 UITabbarSimpleDemo[986:30480] -[ViewController tabBarControllerSupportedInterfaceOrientations:]
- 当你选择一个item的时候,调用堆栈为:
- tabBar:didSelectItem:
- tabBarController:shouldSelectViewController:
- tabBarController:animationControllerForTransitionFromViewController:toViewController:
- tabBarController:didSelectViewController:
2017-04-06 09:54:17.264 UITabbarSimpleDemo[986:30480] ----[ViewController tabBar:didSelectItem:]
- 当你选择一个item的时候,调用堆栈为:
2017-04-06 09:54:17.264 UITabbarSimpleDemo[986:30480] -[ViewController tabBarController:shouldSelectViewController:]
2017-04-06 09:54:17.265 UITabbarSimpleDemo[986:30480] -[ViewController tabBarController:animationControllerForTransitionFromViewController:toViewController:]
2017-04-06 09:54:17.267 UITabbarSimpleDemo[986:30480] -[ViewController tabBarController:didSelectViewController:]
```
4. 当存在一个 More的时候,点击More里面的子控制器,不会调用UITabbarControllerDelegate 或者 UITabBarDelegate
5. 当存在一个 More的时候,点击edit, 调用 tabBar:willBeginCustomizingItems: 及tabBar:didBeginCustomizingItems:, 点击edit,会调用 tabBar:willEndCustomizingItems:changed: 以及 tabBar:didEndCustomizingItems:changed:
```
2017-04-06 10:04:25.463 UITabbarSimpleDemo[986:30480] ----[ViewController tabBar:willBeginCustomizingItems:]
2017-04-06 10:04:25.794 UITabbarSimpleDemo[986:30480] ----[ViewController tabBar:didBeginCustomizingItems:]
2017-04-06 10:04:27.017 UITabbarSimpleDemo[986:30480] ----[ViewController tabBar:willEndCustomizingItems:changed:]
2017-04-06 10:04:27.349 UITabbarSimpleDemo[986:30480] ----[ViewController tabBar:didEndCustomizingItems:changed:]
```
这个几个方法,都没有被调用,不知道是不是系统bug
- (void)tabBarController:(UITabBarController *)tabBarController willBeginCustomizingViewControllers:(NSArray<__kindof UIViewController *> *)viewControllers NS_AVAILABLE_IOS(3_0) __TVOS_PROHIBITED
{
NSLog(@"%s", __func__);
}
- (void)tabBarController:(UITabBarController *)tabBarController willEndCustomizingViewControllers:(NSArray<__kindof UIViewController *> *)viewControllers changed:(BOOL)changed NS_AVAILABLE_IOS(3_0) __TVOS_PROHIBITED
{
NSLog(@"%s", __func__);
}
- (void)tabBarController:(UITabBarController *)tabBarController didEndCustomizingViewControllers:(NSArray<__kindof UIViewController *> *)viewControllers changed:(BOOL)changed __TVOS_PROHIBITED
{
NSLog(@"%s", __func__);
}
- (UIInterfaceOrientation)tabBarControllerPreferredInterfaceOrientationForPresentation:(UITabBarController *)tabBarController NS_AVAILABLE_IOS(7_0) __TVOS_PROHIBITED
{
NSLog(@"%s", __func__);
return UIInterfaceOrientationLandscapeRight;
}
- (nullable id <UIViewControllerInteractiveTransitioning>)tabBarController:(UITabBarController *)tabBarController
interactionControllerForAnimationController: (id <UIViewControllerAnimatedTransitioning>)animationController NS_AVAILABLE_IOS(7_0)
{
NSLog(@"%s", __func__);
return nil;
}
UITabbarController & UITabbar 学习的更多相关文章
- ios7 - Custom UItabbar has a gap in the bottom
3down votefavorite Im trying to create a custom UITabbar using images for the selected and unselec ...
- iOS-学习UIKIt框架的重要性
前言: 众所周知,我们的移动设备的屏幕上可以展示很多图形界面,作为用户的我们可以通过屏幕上的图形界面浏览信息,也可以通过与图形界面的简单交互,在移动设备上实现各种各样的功能操作.....可以说,没 ...
- [BS-30] 你真的会用storyboard开发吗?
你真的会用storyboard开发吗? 随着苹果大屏手机的推出,苹果公司马上推出了屏幕适配的一些东西Constraints and Size Classes同时,在开发项目时候,是使用sb还是写代 ...
- iPhone/iOS开启个人热点的相关位置调整小结
冬至已到,圣诞将近,最近公司项目实在太多,三四个项目反复的切换真的让人焦头烂额,趁今天有点空,把维护的三个项目顺利送出,刚好可以缕缕思路,记录一下最近遇到的问题.说不着急那是假的,客户一天天的催的确实 ...
- 【原】iOS学习之UITabBar的隐藏
当页面使用 UITabBarController + UINavigationController 框架的时候,当跳转到详情页面的时候,如果 UITabBar 仍然存在的话就会造成逻辑混乱,用户体验也 ...
- iOS阶段学习第33天笔记(自定义标签栏(UITabBar)介绍)
iOS学习(UI)知识点整理 一.自定义标签栏 1.方法一 单个创建标签栏 #import "AppDelegate.h" #import "SecondViewCont ...
- iOS学习28之UITabBarController
1. 标签视图控制器 -- UITabBarController 视图(UIView) ---> 图层 ---> 子视图 视图控制器(UIViewController) ---> 管 ...
- UI学习笔记---第十二天UITabBarController
页签视图控制器-UITabBarController 自定义UITabBar block高级 一.UITabBarController 结构为三层:Tab bar controller v ...
- iOS学习之UITabBarController
一.标签视图控制器——UITabBarController 1.UITabBarController的继承关系: @interface UITabBarController : UIViewContr ...
随机推荐
- ansible-playbook -l 选项
-l <SUBSET>, --limit <SUBSET> further limit selected hosts to an additional pattern 限制脚本 ...
- django 的 一对多的关系
USERINFO 用户详情表 USERTYPE 用户类别表 UserType是父表,UserInfo是子表, user_type 是 关联字段 就是新增资源的时候,又对数据库重新查询一遍,太消耗资源了 ...
- 用WebService实现对数据库进行操作(添加+删除+修改)(转)
转自:http://blog.csdn.net/beyondqd/article/details/6703169 表为User,字段有 编号: int id,用户名:string UserName,密 ...
- Kubernetes组件及网络基础
在前面的部分了解了Pod的创建删除 ,查看信息等.那么我们怎么去管理Pod呢?我们可以通过 ReplicationController 去管理维护 Pod. Replication Controlle ...
- 函数 FUNCTION
函数 FUNCTION 定义: 带名字的代码块,用于执行具体任务. 注意: 应给函数指定描述性名称,只是用小写字母和下划线. 函数代码块以 def 关键词开头,后接函数标识符名称和圆括号 (). 任何 ...
- 《剑指offer》面试题23 从上往下打印二叉树 Java版
注意层序遍历的时候对每一层的处理方式可能不同,这里把每一层的元素保存进一个List中了,那么就需要记录每一层的数量. public List<List<Integer>> se ...
- 题解 CF1140D 【Minimum Triangulation】
题意:求将一个n边形分解成(n-2)个三边形花费的最小精力,其中花费的精力是所有三角形的三顶点编号乘积的和(其中编号是按照顶点的顺时针顺序编写的) 考虑1,x,y连了一个三角形,x,y,z连了一个三角 ...
- 小白学Python——用 百度翻译API 实现 翻译功能
本人英语不好,很多词组不认识,只能借助工具:百度翻译和谷歌翻译都不错,近期自学Python,就想能否自己设计一个百度翻译软件呢? 百度翻译开放平台: http://api.fanyi.baidu.co ...
- C语言--一维数组,字符数组
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/zuoyou1314/article/details/30799519 watermark/2/tex ...
- 执行npm publish 报错:403 Forbidden - PUT https://registry.npmjs.org/kunmomotest - you must verify your email before publishing a new package: https://www.npmjs.com/email-edit
前言 执行npm publish 报错:403 Forbidden - PUT https://registry.npmjs.org/kunmomotest - you must verify you ...