首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏iOS知识点

    iOS-UITabBarController的基本使用

    使用步骤: 1.初始化UITabBarController 2.设置UIWindow的rootViewController为UITabBarController 3.根据具体情况,通过addChildViewController UITabBarController添加控制器的方式有2种 添加单个子控制器 (void)addChildViewController:(UIViewController *)childController UITabBarController *tabBar = [[UITabBarController alloc] init]; UIViewController *vc1 = [[UIViewController

    83910发布于 2019-12-12
  • 来自专栏向治洪

    UITabBarController实现Tab切换

    在Android中很多控件可以实现这类效果,TabLayout、TabHost… 而在iOS中系统为我们提供了UITabBarController类来实现Tab页面之间的切换。 有几个页面我们就创建几个UINavigationController,然后通过tabbar.viewControllers = @[navi1, navi2, navi3…]; 设置给UITabBarController viewDidLoad]; // Do any additional setup after loading the view from its nib. } @end 创建UITabBarController UINavigationController *navi3 = [[UINavigationController alloc]initWithRootViewController:blueVC]; //创建UITabBarController 对象 UITabBarController *tabbar = [[UITabBarController alloc]init]; //设置tabbar的子控制器 tabbar.viewControllers

    2.6K80发布于 2018-02-06
  • 来自专栏落影的专栏

    UITabbarController 偶现启动crash问题分析

    报错内容如下: NSException -[UITabBarController setSelectedViewController:] only a view controller in the tab 该问题在灰度有出现过,一位同事在排查过程中,发现另外一个类似问题是在UITabBarController的 _viewControllerForTabBarItem:方法出现异常,这个问题量级并不大,场景类似但是没有特别信息帮助定位 多维分析 由于crash出现在系统的UITabBarController类,无法调试获取更多信息,逆向排查周期太长。这里可以通过Slardar的信息,结合日志和业务场景逐步缩小排查范围。 这里写了一个复用的模拟代码: - (void)testAnotherTabbarVC { UITabBarController *anotherTabbarVC = [UITabBarController

    1.1K40编辑于 2022-10-28
  • 来自专栏学海无涯

    iOS26适配指南之UITabBarController

    介绍 增加了类型为UITabBarController.MinimizeBehavior的tabBarMinimizeBehavior属性,用于设置 Tabbar 最小化时的行为。 import UIKit // MARK: - 自定义UITabBarController class TabBarController: UITabBarController { override

    2.7K12编辑于 2025-07-22
  • 来自专栏sktj

    IOS 菜单栏 UITabBarController 常用

    = SecondViewController() let thirdViewController = ThirdViewController() let tabViewController = UITabBarController

    1.6K20发布于 2019-07-07
  • 来自专栏学海无涯

    iOS18适配指南之UITabBarController

    增加了类型为 UITabBarController.Mode 的mode属性,用于设置显示模式,共有 3 种取值,分别为automatic、tabBar与tabSidebar。 案例 代码 自定义 UITabBarController。 import UIKit class TabBarController: UITabBarController { override func viewDidLoad() { : UITabBarControllerDelegate { // MARK: Tab是否可以选中 func tabBarController(_ tabBarController: UITabBarController Bool { return true } // MARK: 选中Tab func tabBarController(_ tabBarController: UITabBarController

    76110编辑于 2025-02-10
  • 来自专栏学海无涯

    iOS18适配指南之UITabBarController

    增加了类型为 UITabBarController.Mode 的mode属性,用于设置显示模式,共有 3 种取值,分别为automatic、tabBar与tabSidebar。 案例代码自定义 UITabBarController。 import UIKitclass TabBarController: UITabBarController { override func viewDidLoad() { super.viewDidLoad UITab) -> Bool { return true } // MARK: 选中Tab func tabBarController(_ tabBarController: UITabBarController selectedTab.title) } // MARK: 开始编辑 func tabBarControllerWillBeginEditing(_ tabBarController: UITabBarController

    2.5K11编辑于 2024-09-17
  • 来自专栏Python疯子

    Swift -标签页控制器(UITabBarController)用法

    selectedImage: moreSelectImage) let navArray = [HomeNC, CenterNC, MoreNC] let tabBarController = UITabBarController / Dispose of any resources that can be recreated. } } 下载Demo:https://github.com/silencesmile/Swift_UITabBarController

    3.3K42发布于 2018-09-06
  • 来自专栏DannyHoo的专栏

    如何判断UITabBarController上的NavigationController没有被选中?

    这也与本篇博客的题目相呼应:如何判断UITabBarController上的NavigationController没有被选中?

    1.1K10发布于 2018-09-13
  • 来自专栏一“技”之长

    iOS开发中标签控制器的使用——UITabBarController

    iOS开发中标签控制器的使用——UITabBarController 一、引言         与导航控制器相类似,标签控制器也是用于管理视图控制器的一个UI控件,在其内部封装了一个标签栏,与导航不同的是 二、创建一个标签控制器         通过如下的步骤,我们可以很简便的创建一个TabBarController: UITabBarController * tabBar= [[UITabBarController 三、UITabBarController的属性和方法 //管理的viewController数组 @property(nullable, nonatomic,copy) NSArray<__kindof

    2.5K20发布于 2018-08-15
  • 来自专栏iOS开发~

    iOS_自定义UITabBarController标签视图控制器

    首先创建一个类,继承自UItabBarController 然后在.m文件中: 这里我有两个宏定义: #define WIDTH (myView.frame.size.width / 4) //我在写

    88330编辑于 2022-07-20
  • 来自专栏mukekeheart的iOS之旅

    iOS学习——获取当前最顶层的ViewController

    在寻找的过程中,要分别考虑当前ViewController是UITabBarController和UINavigationController的情况,同时还要考虑到当前ViewController是否通过 topViewController:[(UINavigationController *)vc topViewController]]; } else if ([vc isKindOfClass:[UITabBarController class]]) { return [self _topViewController:[(UITabBarController *)vc selectedViewController] presented出来的 rootVC = [rootVC presentedViewController]; } if ([rootVC isKindOfClass:[UITabBarController class]]) { // 根视图为UITabBarController currentVC = [self getCurrentVCFrom:[(UITabBarController

    7.2K50发布于 2018-02-28
  • 来自专栏進无尽的文章

    实践 -实现一款中间凸起的TabBar

    使用KVC将自定义UITabBar 赋值给 UITabBarControllerUITabBarController中给自定义UITabBar上面的按钮绑定事件,来联动UITabBarController 处理UITabBarController 注意是 vc2.title=@"医疗"; 而不是 vc2.tabBarItem.title =@"医疗"; 如果是第二种方法,在设置图片为空的时候,Tabbar tabBarItem.selectedImage=[[UIImage imageNamed:@""] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; 由于UITabBarController KVC 将自己的tabbar赋给系统tabBar [self setValue:_mcTabbar forKeyPath:@"tabBar"]; 自定义UITabBar上面的按钮绑定事件,来联动UITabBarController self.selectedIndex = 1;//关联中间按钮 [self rotationAnimation]; } //tabbar选择时的代理 - (void)tabBarController:(UITabBarController

    2.6K20发布于 2018-09-12
  • 来自专栏大宇笔记

    iOS didFinishLaunchingWithOptions方法里获取storyBoard的rootViewController

    UITabBarController  *  tabBar  =  (UITabBarController *)application.delegate.window.rootViewController

    1.5K30发布于 2019-01-15
  • 来自专栏大宇笔记

    swift 获取控制器

    isKind(of: UITabBarController.self))! { vc = (vc as! UITabBarController).selectedViewController }else if (vc?.

    1.7K20发布于 2019-01-15
  • 来自专栏Alan's Lab

    iOS 自定义 ViewController 过渡动画

    在上面链接的视频里说到,一共有下面这四个地方可以用自定义过渡: Presentations and dismissals UITabBarController UINavigationController UICollectionViewController layout-to-layout transitions 这个例子里,我们只涉及第二种 UITabBarController 另外还有 Interactive UIViewControllerAnimatedTransitioning optional func tabBarController(_ tabBarController: UITabBarController 然后在 viewDidLoad 中设置 TabBarController 的 delegate ,这里我们设置成为 self TabBarController 代码如下: class MainVC: UITabBarController delegate设置为self } /* 如GIF中那样在切换时改变状态栏颜色,这里可选,与过渡无关 func tabBarController(tabBarController: UITabBarController

    1.8K31发布于 2018-10-19
  • 来自专栏日常技术分享

    iOS 13 TabBar文字选中颜色PoP变为蓝色问题解决

    解决办法是给UITabBarController设置默认值 //这里的self是UITabBarController self.tabBar.tintColor = selColor;

    2.1K20发布于 2019-12-30
  • 来自专栏全栈程序员必看

    iOS 在TabViewController中的一个ViewController跳转到另一种ViewController

    在须要跳转的地方: AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; UITabBarController *tabViewController = (UITabBarController *) appDelegate.window.rootViewController; [tabViewController 參考: http://stackoverflow.com/questions/10307350/any-code-example-of-how-access-viewcontroller-from-uitabbarcontroller

    61010编辑于 2022-07-18
  • 来自专栏進无尽的文章

    UI篇-UITabBar及其相关其他知识

    和UINavigationController类似,UITabBarController也可以轻松地管理多个控制器,轻松完成控制器之间的切换。 UITabBarController的视图结构如下; ? Paste_Image.png UITabBar 下方的工具条称为UITabBar ,如果UITabBarController有N个子控制器,那么UITabBar内部就会有N 个UITabBarButton 在上面的程序中,UITabBarController有4个子控制器,所以UITabBar中有4个UITabBarButton,UITabBar的结构⼤大致如下图所示: ? 每个视图控制器都有一个tabBarItem属性,通过它控制视图在UITabBarController的tabBar中的显示信息。

    2.6K20发布于 2018-09-12
  • 来自专栏非典型技术宅

    iOS多控制器之UINavigationController&UITableBarController1. 多控制器2. UINavigationController3. UITableBarCont

    控制器A被称为控制器B、C、D的“父控制器” 控制器B、C、D的被称为控制器A的“子控制器” 为了便于管理控制器,iOS提供了2个比较特殊的控制器: UINavigationController UITabBarController UITableBarController UITabBarController和UINavigationController类似,UITabBarController也可以轻松地管理多个控制器,轻松完成控制器之间的切换 UITabBarController的创建过程可以参考UINavigationController ? Paste_Image.png 3.1. UITableBarController的界面说明 下方的工具条称为UITabBar ,如果UITabBarController有N个子控制器,那么UITabBar内部就会有N 个UITabBarButton Paste_Image.png 7.2.3 往UITabBarController中添加子控制器 有两种方法UITabBarController中添加子控制器 : [tb addChildViewController

    2K40发布于 2018-06-28
领券