最后更新2016-04-06

一、 UITabbarController

  1. 给UITabbarController 设置viewControllers熟悉时候,超过五个就会有一个 moreNavigationController;

调用 UITabbarController 的 addChildViewController 可以给系统设置,但是超过五个之后就不显示了;

  1. 调用顺序

  2. 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:]

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 学习的更多相关文章

  1. 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 ...

  2. iOS-学习UIKIt框架的重要性

      前言: 众所周知,我们的移动设备的屏幕上可以展示很多图形界面,作为用户的我们可以通过屏幕上的图形界面浏览信息,也可以通过与图形界面的简单交互,在移动设备上实现各种各样的功能操作.....可以说,没 ...

  3. [BS-30] 你真的会用storyboard开发吗?

    你真的会用storyboard开发吗?   随着苹果大屏手机的推出,苹果公司马上推出了屏幕适配的一些东西Constraints and Size Classes同时,在开发项目时候,是使用sb还是写代 ...

  4. iPhone/iOS开启个人热点的相关位置调整小结

    冬至已到,圣诞将近,最近公司项目实在太多,三四个项目反复的切换真的让人焦头烂额,趁今天有点空,把维护的三个项目顺利送出,刚好可以缕缕思路,记录一下最近遇到的问题.说不着急那是假的,客户一天天的催的确实 ...

  5. 【原】iOS学习之UITabBar的隐藏

    当页面使用 UITabBarController + UINavigationController 框架的时候,当跳转到详情页面的时候,如果 UITabBar 仍然存在的话就会造成逻辑混乱,用户体验也 ...

  6. iOS阶段学习第33天笔记(自定义标签栏(UITabBar)介绍)

    iOS学习(UI)知识点整理 一.自定义标签栏 1.方法一 单个创建标签栏 #import "AppDelegate.h" #import "SecondViewCont ...

  7. iOS学习28之UITabBarController

    1. 标签视图控制器 -- UITabBarController 视图(UIView) ---> 图层 ---> 子视图 视图控制器(UIViewController) ---> 管 ...

  8. UI学习笔记---第十二天UITabBarController

    页签视图控制器-UITabBarController   自定义UITabBar     block高级 一.UITabBarController 结构为三层:Tab bar controller v ...

  9. iOS学习之UITabBarController

    一.标签视图控制器——UITabBarController 1.UITabBarController的继承关系: @interface UITabBarController : UIViewContr ...

随机推荐

  1. 如何将/etc/issue文件中的内容转换为大写后保存至/tmp/issue.out文件中

    cat /etc/issue|tr '[:lower:]' [:upper:] >> /tmp/issue.out

  2. Scrapy输出文件格式问题汇总

    Q:Scrapy抓取的内容(包含中文)输出到JSON Lines文件时如何确保输出的是字符本身而不是其unicode编码? A:默认的JsonLinesItemExporter其ensure_asci ...

  3. HNUSTOJ-1698 送外卖(TSP问题 + 状态压缩DP)

    1698: 送外卖 时间限制: 1 Sec  内存限制: 128 MB提交: 123  解决: 28[提交][状态][讨论版] 题目描述 在美团和饿了么大行其道的今天,囊中羞涩的小周和小美,也随大流加 ...

  4. HNUSTOJ-1520 压缩编码

    1520: 压缩编码 时间限制: 1 Sec  内存限制: 2 MB提交: 107  解决: 54[提交][状态][讨论版] 题目描述 某工业监控设备不断发回采样数据.每个数据是一个整数(0到1000 ...

  5. P1397 [NOI2013]矩阵游戏(递推)

    P1397 [NOI2013]矩阵游戏 一波化式子,$f[1][m]=a^{m-1}+b\sum_{i=0}^{m-2}a^i$,用快速幂+逆元求等比数列可以做到$logm$ 设$v=a^{m-1}, ...

  6. 剑指offer-链表中环的入口结点-链表-python ***

    题目描述 给一个链表,若其中包含环,请找出该链表的环的入口结点,否则,输出null. 思路 第一步,用两个快慢指针找环中相汇点.分别用slow, fast指向链表头部,slow每次走一步,fast每次 ...

  7. Laravel 学习笔记之数据库操作——Eloquent ORM

    1. 时间戳 默认情况下在使用ORM操作数据库进行添加.修改数据时, created_at 和 updated_at列会自动存在于数据表中,并显示的是 ‘2017’格式,如果想以 Unix时间戳格式存 ...

  8. datatable和dataset的区别

    DataSet 是离线的数据源 DataTable 是数据源中的表.当然也可以自己建一张虚表.插入数据库中 DataSet是DataTable的容器DataSet可以比作一个内存中的数据库,DataT ...

  9. ELK报错及解决方案

    ELK报错及解决方案 1.jdk版本问题 报错如下: future versions of Elasticsearch will require Java 11; your Java version ...

  10. 代理层Nginx限流(降级)预案

    典型服务架构介绍 预案适用场景 监控指标 操作手册 相关文档 操作方法 配置语法 配置样例 配置解释 注意事项 典型服务架构介绍 典型的互联网服务访问链路都是分层结构的,从流量入口,到应用层,到后端资 ...