RDVTabBarController

https://github.com/robbdimitrov/RDVTabBarController

效果:

  • Supports iPad and iPhone 支持iPad与iPhone
  • Supports landscape and portrait orientations 支持横竖屏切换动画
  • Can be used inside UINavigationController 可以用在UINavigationController里面
  • Customizable badges 可定制的提示标签

Installation 安装

CocoaPods - cocoaPods

If you're using CocoaPods, simply add pod 'RDVTabBarController' to your Podfile.

如果你使用了CocoaPods,简单的pod ‘RDVTabBarController’ 到你的Podfile文件中就行了。

Drag & Drop - 拖到项目当中

Add the items from RDVTabBarController directory to your project. If you don't have ARC enabled, you will need to set a -fobjc-arc compiler flag on the .m source files.

直接将RDVTabBarController文件夹拖到你的项目当中。如果你的项目是MRC的,你需要在.m文件里面设置-fobjc-arc编译标签。

Example Usage - 使用示例

Initialize RDVTabBarController

初始化RDVTabBarController

The initialization is similar to the one for UITabBarController. Create an instance of the tabBarController and initialize its viewControllers.

初始化方法与UITabBarController类似,创建一个tabBarController的实例以及初始化控制器。

UIViewController *firstViewController = [[RDVFirstViewController alloc] init];
UIViewController *firstNavigationController = [[UINavigationController alloc]initWithRootViewController:firstViewController];UIViewController *secondViewController = [[RDVSecondViewController alloc] init];
UIViewController *secondNavigationController = [[UINavigationController alloc] initWithRootViewController:secondViewController]; UIViewController *thirdViewController = [[RDVThirdViewController alloc] init]; UIViewController *thirdNavigationController = [[UINavigationController alloc] initWithRootViewController:thirdViewController]; RDVTabBarController *tabBarController = [[RDVTabBarController alloc] init]; [tabBarController setViewControllers:@[firstNavigationController, secondNavigationController, thirdNavigationController]]; self.viewController = tabBarController;

Customize RDVTabBarController - 定制RDVTabBarController

Each RDVTabBarItem has selectedBackgroundunselectedBackground and corresponding properties for the icons: selectedImage and unselectedImage.

每一个RDVTabBarItem都有选择被背景与未选择的背景,或者是对应于选择的图片与未选择的图片。

UIImage *finishedImage = [UIImage imageNamed:@"tabbar_selected_background"];
UIImage *unfinishedImage = [UIImage imageNamed:@"tabbar_normal_background"]; NSArray *tabBarItemImages = @[@"first", @"second", @"third"]; RDVTabBar *tabBar = [tabBarController tabBar]; [tabBar setFrame:CGRectMake(CGRectGetMinX(tabBar.frame), CGRectGetMinY(tabBar.frame), CGRectGetWidth(tabBar.frame), 63)]; NSInteger index = 0; for (RDVTabBarItem *item in [[tabBarController tabBar] items]) { [item setBackgroundSelectedImage:finishedImage withUnselectedImage:unfinishedImage]; UIImage *selectedimage = [UIImage imageNamed:[NSString stringWithFormat:@"%@_selected", [tabBarItemImages objectAtIndex:index]]]; UIImage *unselectedimage = [UIImage imageNamed:[NSString stringWithFormat:@"%@_normal", [tabBarItemImages objectAtIndex:index]]]; [item setFinishedSelectedImage:selectedimage withFinishedUnselectedImage:unselectedimage]; index++; }

Make the tab bar translucent - 可以让tab bar变得半透明

RDVTabBar has translucent property which determines how it is going to be handled.

RDVTabBar有着半透明色这个属性,他决定着怎么个透明方式。

RDVTabBar *tabBar = tabBarController.tabBar;// After the tabBarController initialization
tabBar.translucent = YES;// Customize the tabBar background
tabBar.backgroundView.backgroundColor = [UIColor colorWithRed:245/255.0 green:245/255.0 blue:245/255.0 alpha:0.9]]; // Inside the tabbed viewControllers - (void)viewDidLoad { [super viewDidLoad]; ... if (self.rdv_tabBarController.tabBar.translucent) { CGFloat tabBarHeight = CGRectGetHeight(self.rdv_tabBarController.tabBar.frame); UIEdgeInsets insets = UIEdgeInsetsMake(0, 0, tabBarHeight, 0); self.tableView.contentInset = insets; self.tableView.scrollIndicatorInsets = insets; } } 

Requirements - 需要的环境

  • ARC
  • iOS 5.0 or later
  • Xcode 5

Contact

Robert Dimitrov
@robbdimitrov

转载于:https://www.cnblogs.com/YouXianMing/p/4166416.html

[翻译] RDVTabBarController相关推荐

  1. Mysql函数group_concat、find_in_set 多值分隔字符字段进行数据库字段值翻译

    Mysql函数group_concat.find_in_set进行数据库字段值翻译 场景 配方表:记录包含的原料 sources表示原料,字段值之间用逗号分隔 原料表:对应原料id和原料名称 现需要查 ...

  2. “Attention is All You Need 翻译

    <p><img src="output_0_0.png" alt="png"></p> "Attention is ...

  3. 基于PyTorch的Seq2Seq翻译模型详细注释介绍(一)

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/qysh123/article/deta ...

  4. 全文翻译(全文合集):TVM: An Automated End-to-End Optimizing Compiler for Deep Learning

    全文翻译(全文合集):TVM: An Automated End-to-End Optimizing Compiler for Deep Learning 摘要 人们越来越需要将机器学习应用到各种各样 ...

  5. 全文翻译(四) TVM An Automated End-to-End Optimizing Compiler

    全文翻译(四) TVM An Automated End-to-End Optimizing Compiler 6.3 嵌入式GPU评估 对于移动GPU实验,在配备ARM Mali-T860MP4 G ...

  6. 全文翻译(三) TVM An Automated End-to-End Optimizing Compiler

    全文翻译(三) TVM An Automated End-to-End Optimizing Compiler 5. 自动化优化 考虑到一组丰富的调度原语,剩下的问题是为DL模型的每一层,找到最佳的算 ...

  7. 全文翻译(二): TVM: An Automated End-to-End Optimizing Compiler for Deep Learning

    全文翻译(二): TVM: An Automated End-to-End Optimizing Compiler for Deep Learning 3.优化计算图 计算图是在DL框架中表示程序的常 ...

  8. 全文翻译(一):TVM: An Automated End-to-End Optimizing Compiler for Deep Learning

    全文翻译(一):TVM: An Automated End-to-End Optimizing Compiler for Deep Learning 摘要 人们越来越需要将机器学习应用到各种各样的硬件 ...

  9. YOLOv4全文阅读(全文中文翻译)

    YOLOv4全文阅读(全文中文翻译) YOLOv4: Optimal Speed and Accuracy of Object Detection 论文链接: https://arxiv.org/pd ...

最新文章

  1. 数据输出:如何将数据带给页面||SpringMVC除过在方法上传入原生的request和session外还能怎么样把数据带给页面
  2. 28. Leetcode 25. K 个一组翻转链表 (链表-反转链表)
  3. Java io流学习总结(三)
  4. 潘正磊:再过三五年 AI会变成开发人员的基本概念
  5. AIX操作系统基本命令
  6. 注册域名需要资格吗_域名对于企业商标注册的重要性你知道吗?
  7. 微软私有云分享(R2)24 审核WDS部署
  8. zend studio代码自动提示问题,有的提示正常有的提示不正常,解决方法
  9. 代理服务器好帮手--SOCKS2HTTP
  10. html解决页面放大后元素乱排的问题
  11. 2021年7月整理--简单方法 暴力破解WIFI密码
  12. 3dmax烘焙贴图主要设置之Flatiron
  13. HttpClient4.x使用中出现的几个问题及解决方法
  14. python应该怎么样自学_Python该如何自学?
  15. c语言标志位flag怎么用,怎么用flag标志位当单片机中断标志来用
  16. HDU-6441-Find Integer-费马大定理+奇偶数列法则
  17. 百分制成绩转换五分制F【Python习题】(保姆级图文+实现代码)
  18. linux 使用 nginx 搭建 zookeeper 集群
  19. 差分信号经运放后转为单端输出供单片机采集原理图
  20. iOS 清理某一个cookies 或者全部 cookies

热门文章

  1. 查询已有链表的hashmap_面试官再问你 HashMap 底层原理,就把这篇文章甩给他看...
  2. java tostring的用处_JAVA的tostring()方法的作用是什么呢?
  3. matlab变参传函,什么是传递函数的增益
  4. 带权并查集-Building Block
  5. java调用打印机打印需要进行什么操作_Java调用打印机程序有什么特点?
  6. Web前端期末大作业--汽车主题网页设计002(HTML+CSS+JavaScript+)实现
  7. flash 火狐总是崩溃_win10系统火狐flash插件总是崩溃的解决方法
  8. linux svn 服务器下载,Linux下搭建SVN服务器完全手册
  9. vue 根据swagger 生成接口_采用vue编写的功能强大的swagger-ui页面
  10. Redis流水线性能提高