zoukankan      html  css  js  c++  java
  • UITabbarController & UITabbar 学习

    最后更新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;
    }
    
    
  • 相关阅读:
    SAP:建表时如果有QUAN、CURR类型的字段不能激活的问题
    ABAP:ALV的 Header中添加HTML内容
    iframe中cookie失效问题
    让flash自动显示代码提示的两种方式
    event.srcElement说明,方法,技巧
    ABAP:FI常用BAPI
    加入收藏夹功能(jQuery)
    ABAP笔记:BDC完整版例子
    BDC处理时用到结构BDCDATA
    ABAP 自动生成EXCEL文件并作简单格式处理
  • 原文地址:https://www.cnblogs.com/gaox97329498/p/12070549.html
Copyright © 2011-2022 走看看