您的位置:首页 > 产品设计 > UI/UE

UITabBarController

2016-01-10 20:57 447 查看
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, *)
/// 获取UITabBar
public var tabBar: UITabBar { get }


2 Managing the View Controllers

/// 当前管理的所有UIViewController
public var viewControllers: [UIViewController]?

/// 是否动画设置[UIViewController]
///
/// - parameter viewControllers : [UIViewController]
/// - parameter animated: Bool
///
/// - returns: void
public func setViewControllers(viewControllers: [UIViewController]?, animated: Bool)

/// 更多的导航界面
public var moreNavigationController: UINavigationController { get }
/// 更多中显示的[UIViewController]
public var customizableViewControllers: [UIViewController]?


3 Managing the Selected Tab

/// 选中的UIViewController
unowned(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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: