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

    iOS TabBarController实例

    -(BaseNavigationController*)setTabBarItemWithRootVC:(id)vc Image:(NSString*)imgName SelectedImage:(NSString*)selectedImg { BaseNavigationController *nav = [[BaseNavigationController alloc] init]; [nav.tabBarItem setImage:[[UIImage imageNamed:imgNam

    67520发布于 2019-12-18
  • 来自专栏iOSer成长记录

    iOS-可交互滑动的TabBarController

    1.先看一下效果 左右滑动交互的TabBarController 2.在iOS7.0以前,要实现这样的效果,只有自定义TabBar了,但这很麻烦。 :(UITabBarController *)tabBarController animationControllerForTransitionFromViewController :当前的tabBarController * animationController:动画百分比控制器 * 返回一个自定义的动画百分比控制器,以控制当前动画进行的百分比。 */ - (nullable id <UIViewControllerInteractiveTransitioning>)tabBarController:(UITabBarController *)tabBarControllerTabBarController中,添加一个pan手势 - (void)viewDidLoad { [super viewDidLoad]; self.delegate = self;

    2.2K41发布于 2018-06-29
  • 来自专栏iOS逆向与安全

    iOS中tabBar按钮再次点击实现界面刷新(包含完整demo)【特色功能:在更新数据期间旋转tabbar的icon】

     NSInteger previousClickedTag; 1.2 实现 UITabBarControllerDelegate 进行数据刷新 将selectedViewController设置为tabBarController 的delegate     self.tabBarController.delegate = self; - (void)tabBarController:(UITabBarController *)tabBarController  = self;               self.previousClickedTag = 100;//默认没有点击任何tabbar      } - (void)tabBarController :(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController{      ]) {                  //进行数据刷新                  if ( self.previousClickedTag ==  tabBarController.selectedIndex

    3.6K20发布于 2021-03-08
  • 来自专栏sktj

    IOS 导航栏 菜单栏 结合 常用

    let firstViewController = FirstViewController() let thirdViewController = ThirdViewController() let tabBarController UITabBarController() let navigationController =UINavigationController(rootViewController:firstViewController) tabBarController.viewControllers =[navigationController, thirdViewController] let tabBar = tabBarController.tabBar let item = tabBar.items rootViewController = tabBarController return true }

    1.1K10发布于 2019-07-07
  • 来自专栏Alan's Lab

    iOS 自定义 ViewController 过渡动画

    然后在 viewDidLoad 中设置 TabBarController 的 delegate ,这里我们设置成为 self TabBarController 代码如下: class MainVC: UITabBarController let index = find(tabBarController.viewControllers! 就会根据它去执行过渡动画 func tabBarController(tabBarController: UITabBarController, animationControllerForTransitionFromViewController let fromViewControllerIndex = find(self.tabBarController.viewControllers! let tabBarItemCount = tabBarController.tabBar.items!.

    1.8K31发布于 2018-10-19
  • 来自专栏云原生布道专栏

    【IOS开发基础系列】Storyboard专题

    切换到MainStoryboard.storyboard,拖一个 TabBarController 到画布中。 新的 TabBarController 已经事先配置了两个ViewController,每个Tab 按钮一个。 在画布中,原来指向最初的 ViewController 的箭头,现在指向了TabBarController。 这样故事板中只会有一个TabbarController和它的两个 viewcontroller。          现在将新场景连接到TabBarController 。ctrl+左键,从TabBarController拖一条线到NavigationController.         

    5.3K30编辑于 2023-10-16
  • 来自专栏学海无涯

    iOS18适配指南之UITabBarController

    tabBarController(_ tabBarController: UITabBarController, shouldSelectTab tab: UITab) -> Bool { return true } // MARK: 选中Tab func tabBarController(_ tabBarController: UITabBarController, didSelectTab (_ tabBarController: UITabBarController, displayOrderDidChangeFor group: UITabGroup) { print(# = TabBarController() // iOS18新增,设置显示模式 tabBarController.mode = .tabSidebar window rootViewController = tabBarController window?.makeKeyAndVisible() }}UIViewController。

    2.6K11编辑于 2024-09-17
  • 来自专栏学海无涯

    iOS18适配指南之UITabBarController

    import UIKit class TabBarController: UITabBarController { override func viewDidLoad() { func tabBarController(_ tabBarController: UITabBarController, shouldSelectTab tab: UITab) -> Bool { return true } // MARK: 选中Tab func tabBarController(_ tabBarController: UITabBarController = TabBarController() // iOS18新增,设置显示模式 tabBarController.mode = .tabSidebar window rootViewController = tabBarController window?.makeKeyAndVisible() } } UIViewController。

    83210编辑于 2025-02-10
  • 来自专栏蜉蝣禅修之道

    关于iOS Tabbar的一些设置

    设置tabbar选中颜色 iOS7设置如下: [self.tabBarController.tabBarsetSelectedImageTintColor:[UIColor greenColor]]; { NSArray * tabBarSubviews = [tabBarController.tabBar subviews]; int index4SelView; if(tabBarController.selectedIndex+1 > 4) {//selected the last tab. index4SelView = [tabBarSubviews count]-1; } else if([tabBarController.viewControllers count] index4SelView = [tabBarSubviews count] - [tabBarController.viewControllers count] + tabBarController.selectedIndex

    1.6K40发布于 2018-05-23
  • 来自专栏iOS122-移动混合开发研究院

    VCTransitionsLibrary –自定义iOS交互式转场动画的库

    为了给动画一个合适的方向,你可以比较两个视图控制器的索引: - (id <UIViewControllerAnimatedTransitioning>)tabBarController:(UITabBarController *)tabBarController animationControllerForTransitionFromViewController:(UIViewController indexOfObject:fromVC]; NSUInteger toVCIndex = [tabBarController.viewControllers indexOfObject:toVC :(UITabBarController *)tabBarController animationControllerForTransitionFromViewController indexOfObject:fromVC]; NSUInteger toVCIndex = [tabBarController.viewControllers indexOfObject:toVC

    2.2K60发布于 2018-01-02
  • 来自专栏DannyHoo的专栏

    iOS开发中点击UITabBarItem弹出一个控制器(如常见未登录用户点击购物车弹出登录页面的效果)

    我在AppDelegate中将TabBarController设置了window的rootController,因此在AppDelegate中设置tabBarController的代理(遵守协议:UITabBarControllerDelegate ),实现协议中的方法: #pragma mark --- UITabBarControllerDelegate - (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController{ UINavigationController

    1.8K10发布于 2018-09-13
  • 来自专栏iOS122-移动混合开发研究院

    RDVTabBarController--可自由定制的iOS底部导航控件

    RDVTabBarController:一个十分完善的tabBarController,可以自定义角标个数,爽的停不下来。 :(RDVTabBarController )tabBarController shouldSelectViewController:(UIViewController )viewController; /** Tells the delegate that the user selected an item in the tab bar. */ (void)tabBarController:(RDVTabBarController )tabBarController didSelectViewController:(UIViewController )viewController; ``` 还有需要多等待你去发现... 结语 RDVTabBarController是一个很棒的第三方tabBarController,值得我们学习和思考。

    1.4K100发布于 2018-01-02
  • 来自专栏测试游记

    从0开发一款IOS APP(第一天)

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; UITabBarController *tabbarController UIViewController alloc]init]; controller4.view.backgroundColor = [UIColor lightGrayColor]; [tabbarController setViewControllers:@[controller1,controller2,controller3,controller4]]; self.window.rootViewController = tabbarController self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; UITabBarController *tabbarController controller4.tabBarItem.selectedImage = [UIImage imageNamed:@"ico.bundle/home_selected@2x.png"]; [tabbarController

    1.5K60发布于 2019-07-19
  • 来自专栏進无尽的文章

    Swift| 基础语法(五)

    () tabbarController.tabBar.barTintColor = UIColor.white // 注意:视图控制器超过5个时(不包含5)会自动生成一个more视图标签 tabbarController.viewControllers = [nav01, nav02] // 属性设置 // 设置默认被选中视图控制器 tabbarController.selectedIndex = 0; // 设置切换视图 tabBar 属性 // 1 打开用户交互 tabbarController.tabBar.isUserInteractionEnabled = true; // 2 设置背景颜色 tabbarController.tabBar.backgroundColor = UIColor.black tabbarController.tabBar.barTintColor : "") // // 4 选中时的背景图片 // tabbarController.tabBar.selectionIndicatorImage = UIImage(named

    3.7K30发布于 2018-09-12
  • 来自专栏日常技术分享

    iOS TabBar 轮子

    :(UITabBarController *)tabBarController didSelectControl:(UIControl *)control { UIView *animationView cyl_tabImageView]; [self addScaleAnimationOnView:animationView repeatCount:1]; if(tabBarController.selectedIndex [UIScreen mainScreen] bounds]]; [self.window makeKeyAndVisible]; MainTabBarController *tabBarController = [[MainTabBarController alloc] initTabBar]; [self.window setRootViewController:tabBarController dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [tabBarController

    1.4K10编辑于 2021-12-16
  • 来自专栏增长技术

    iOS页面切换的几种方式

    n ]; 3.UITabBarController实现并列画面跳转 //将5个ViewController实例放入TabBar的viewControllers属性中 self.tabBarController.viewControllers = @[navFirst, navSecond, navThird, navFourth, navFifth]; self.window.rootViewController = self.tabBarController ; //将根控制器的视图加到应用程序的主窗口 [self.window addSubview: self.tabBarController.view]; 4.UINavigationController

    2.8K10发布于 2018-09-06
  • 来自专栏猿人谷

    Cocoa编程中视图控制器与视图类详解

    C代码   // 创建一个UITabBarController对象 UITabBarController *tabBarController = [[UITabBarController alloc]  init];   // tabBarController.delegate = self; // 创建一系列要添加到每个具体Tab卡的视图控制器 MyViewController *vc1 = tabBarController:didSelectViewController: 是当用户选择一个新的选项卡时,控制器会发送这个消息。 C代码   - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController viewController   {   // 捕捉selectedIndex,可确定当前所选选项卡     NSNumber *tabNumber = [NSNumber numberWithInt:[tabBarController

    8.4K50发布于 2018-01-17
  • 来自专栏iOS开发随笔

    iOS去除导航栏和tabbar的1px横线

    完成之后的效果 既然导航栏的那一横线能去除,那tabbar那一横线也是能去除的了(其实也是shadowImage来的)··· 方法一: 自定义UITabBarController 方法二: [self.tabBarController.tabBar setBackgroundImage:[UIImage new]]; [self.tabBarController.tabBar setShadowImage:[UIImage new]]; 反之,如果我们想自定义那一横线的颜色也是可以的

    2.1K40发布于 2018-06-28
  • 来自专栏LinXunFeng的专栏

    iOS - Swift 仿微信小红点(无数字)

    $0.removeFromSuperview() } } } } 使用 // 默认4个tabbarItem self.tabBarController tabBar.showBadgOn(index: 2) // 如果不是则用这个方法 // self.tabBarController?.

    1.3K30发布于 2018-06-29
  • 来自专栏進无尽的文章

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

    selectedViewController属性 通过该属性可以获得当前选中的viewController 每个视图控制器都有一个tabBarController属性,通过它可以访问所在的UITabBarController beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.5]; for(UIView *view in self.tabBarController.view.subviews beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.5]; for(UIView *view in self.tabBarController.view.subviews 自定义TbarBar 视图切换时的动画的关键方法(后续会整理出视图切换时的动画实现) - (id <UIViewControllerAnimatedTransitioning>)tabBarController :(UITabBarController *)tabBarController animationControllerForTransitionFromViewController:(UIViewController

    2.7K20发布于 2018-09-12
领券