UITabBarController

来源:互联网 发布:天狼星加密软件 编辑:程序博客网 时间:2024/06/05 04:52

UITabBarController

UITabBar

UITabBarItem


UITabBarController是UITabBar的控制器,这是一个很强大的控制器,在各大app中经常能够看见。

如上图所示的精品推荐、排行榜和探索等按钮就是一个UITabBar,它和UIToolBar很类似,都是处于屏幕的最下方,和UIToolBar不同的地方是它是系统级管理VC的,能够快速跳转到另一个分支的VC中。

1 Accessing the Tab Bar Controller Properties

/// 代理,监听相关跳转信息weak public var delegate: UITabBarControllerDelegate?@available(iOS 3.0, *)/// 获取UITabBarpublic var tabBar: UITabBar { get }

2 Managing the View Controllers

/// 当前管理的所有UIViewControllerpublic var viewControllers: [UIViewController]?/// 是否动画设置[UIViewController]////// - parameter viewControllers : [UIViewController]/// - parameter animated: Bool////// - returns: voidpublic func setViewControllers(viewControllers: [UIViewController]?, animated: Bool)/// 更多的导航界面public var moreNavigationController: UINavigationController { get }/// 更多中显示的[UIViewController]public var customizableViewControllers: [UIViewController]?

3 Managing the Selected Tab

/// 选中的UIViewControllerunowned(unsafe) public var selectedViewController: UIViewController?/// 选中的UIViewController序号,从左到右[0,max]public var selectedIndex: Int

 


其他

源代码

Swift

参考资料

UIKit Framework Reference

UITabBarController Class Reference

文档修改记录

时间 描述 2016-01-10 博文完成

版权所有

CSDN:http://blog.csdn.net/y550918116j

GitHub:https://github.com/937447974/Blog

0 0
原创粉丝点击