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 ...
随机推荐
- 复制/etc目录下所有以p开头,以非数字结尾的文件或目录到/tmp/mytest1目录中
cp -r /etc/p*[a-Z] /tmp/mytest1
- CentOS7 安装SQLCMD
1. Study From https://docs.microsoft.com/zh-cn/sql/linux/sql-server-linux-setup-tools?view=sql-serve ...
- 打印页面内容,<input>不好使,用<textarea> 代替
<textarea class="sld-textarea" onchange="changeTextareaValue(this)">123< ...
- Python生成文本格式的excel\xlwt生成文本格式的excel\Python设置excel单元格格式为文本\Python excel xlwt 文本格式
Python生成文本格式的excel\xlwt生成文本格式的excel\Python设置excel单元格格式为文本\Python excel xlwt 文本格式 解决: xlwt 中设置单元格样式主要 ...
- Django使用Celery进行异步任务
Celery Celery是一个功能完备即插即用的异步任务队列系统.它适用于异步处理问题,当发送邮件.或者文件上传, 图像处理等等一些比较耗时的操作,我们可将其异步执行,这样用户不需要等待很久,提高用 ...
- [LeetCode] 107. 二叉树的层次遍历 II
题目链接 : https://leetcode-cn.com/problems/binary-tree-level-order-traversal-ii/ 题目描述: 给定一个二叉树,返回其节点值自底 ...
- linux下装python3以及pip3
1.wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz 2.tar zxvf Python-3.6.0.tgz 3.cd Pyt ...
- 制作的第一个java小游戏
package java1; import java.awt.*; public class java1 extends Frame { //球桌和桌球图片 Image ball = Toolkit. ...
- Oracle 查询 in条件个数大于1000的解决方案
Oracle 查询 in条件个数大于1000的解决方案,我所了解的有如下四种: 1. 把in分组再or: 思路:如果list的长度为2000,可以500个分一组,就有4个组,这4个组之间再or即可. ...
- http协议是无状态协议,它的无状态指的是什么,如何解决这种情况
http是无状态的协议,也是不安全的协议, 它的无状态是指对于事务处理没有记忆能力,缺少状态意味着后续的操作需要前面的信息. 解决办法:1,通过cookie解决,2,通过session会话保存.