UIToolbar
来源:互联网 发布:js新手可以做的小游戏 编辑:程序博客网 时间:2024/05/16 06:00
UINavigationController
UINavigationBar
UIToolbar
UIBarItem
UIBarButtonItem
- 简介
- 导航效果图
- 导航控制器的对象管理
- 导航控制器内的视图
- Creating Navigation Controllers
- Accessing Items on the Navigation Stack
- Pushing and Popping Stack Items
- Configuring Navigation Bars
- Configuring Custom Toolbars
- Hiding the Navigation Bar
- Accessing the Delegate
- Action Method for Displaying View Controllers
1 简介
在开发app的过程中任何一个项目都会用到UINavigationController,这是一个很有用的控件,它主要控制界面的跳转和导航。
1.1 导航效果图
1.2 导航控制器的对象管理
1.3 导航控制器内的视图
2 Creating Navigation Controllers
/// 使用自定义的navigationBar和toolbar////// - parameter navigationBarClass : AnyClass/// - parameter toolbarClass : AnyClass////// - returns: UINavigationControllerpublic init(navigationBarClass: AnyClass?, toolbarClass: AnyClass?)/// 初始化UINavigationController并指定根VC////// - parameter rootViewController : UIViewController////// - returns: UINavigationControllerpublic init(rootViewController: UIViewController)
3 Accessing Items on the Navigation Stack
/// 顶部UIViewControllerpublic var topViewController: UIViewController? { get } // The top view controller on the stack./// 当前UIViewControllerpublic var visibleViewController: UIViewController? { get } // Return modal view controller if it exists. Otherwise the top view controller./// 当前UINavigationController管理的UIViewControllerpublic var viewControllers: [UIViewController] // The current view controller stack./// 替换堆栈控件的[UIViewController]////// - parameter viewControllers : 要替换的视图/// - parameter animated : 是否动画替换////// - returns: void@available(iOS 3.0, *)public func setViewControllers(viewControllers: [UIViewController], animated: Bool)
4 Pushing and Popping Stack Items
/// push进入下一个VC////// - parameter viewController : UIViewController 目标VC/// - parameter animated : Bool 是否动画跳转////// - returns: voidpublic func pushViewController(viewController: UIViewController, animated: Bool)/// pop回到上一个VC////// - parameter animated : Bool 是否动画跳转////// - returns: 当前UIViewControllerpublic func popViewControllerAnimated(animated: Bool) -> UIViewController?/// pop回到指定VC////// - parameter viewController : UIViewController 目标VC/// - parameter animated : Bool 是否动画跳转////// - returns: 弹出的[UIViewController]public func popToViewController(viewController: UIViewController, animated: Bool) -> [UIViewController]?/// pop回到第一个VC////// - parameter animated : Bool 是否动画跳转////// - returns: 弹出的[UIViewController]public func popToRootViewControllerAnimated(animated: Bool) -> [UIViewController]?/// 手势滑动返回的手势public var interactivePopGestureRecognizer: UIGestureRecognizer? { get }
5 Configuring Navigation Bars
/// 获取UINavigationBarpublic var navigationBar: UINavigationBar { get }/// 是否隐藏UINavigationBarpublic var navigationBarHidden: Bool/// 是否动画隐藏UINavigationBar////// - parameter hidden : 是否隐藏/// - parameter animated : 是否动画////// - returns: voidpublic func setNavigationBarHidden(hidden: Bool, animated: Bool)
6 Configuring Custom Toolbars
/// 获取UIToolbar@available(iOS 3.0, *)public var toolbar: UIToolbar! { get }/// 是否隐藏UIToolbar@available(iOS 3.0, *)public var toolbarHidden: Bool // Defaults to YES, i.e. hidden./// 是否动画隐藏UIToolbar////// - parameter hidden : 是否隐藏/// - parameter animated : 是否动画////// - returns: void@available(iOS 3.0, *)public func setToolbarHidden(hidden: Bool, animated: Bool)
7 Hiding the Navigation Bar
/// 是否点击屏幕隐藏UINavigationBar@available(iOS 8.0, *)public var hidesBarsOnTap: Bool/// 点击屏幕隐藏UINavigationBar的手势@available(iOS 8.0, *)unowned(unsafe) public var barHideOnTapGestureRecognizer: UITapGestureRecognizer { get }/// 是否点击上下滑动隐藏UINavigationBar@available(iOS 8.0, *)public var hidesBarsOnSwipe: Bool/// 滑动隐藏UINavigationBar的手势@available(iOS 8.0, *)public var barHideOnSwipeGestureRecognizer: UIPanGestureRecognizer { get }/// 是否键盘打开时隐藏UINavigationBar@available(iOS 8.0, *)public var hidesBarsWhenKeyboardAppears: Bool /// 是否横屏隐藏UINavigationBar@available(iOS 8.0, *)public var hidesBarsWhenVerticallyCompact: Bool
8 Accessing the Delegate
/// 跳转监听weak var delegate: UINavigationControllerDelegate?
9 Action Method for Displaying View Controllers
/// 和pushViewController:animated:相同的功能,可携带参数传递////// - parameter vc : UIViewController/// - parameter sender : 携带参数////// - returns: voidfunc showViewController(_ vc: UIViewController, sender sender: AnyObject?)
其他
源代码
Swift
参考资料
UIKit Framework Reference
UINavigationController Class Reference
文档修改记录
版权所有
CSDN:http://blog.csdn.net/y550918116j
GitHub:https://github.com/937447974/Blog
0 0
- UIToolBar
- UIToolbar
- UIToolbar
- UIToolbar
- UIToolbar
- UIToolBar
- UIToolbar
- UIToolBar
- UIToolbar
- UIToolBar,UIBarButtonItem
- Transparent UIToolBar
- Transparent UIToolBar
- UIToolBar使用
- swift--- uitoolbar
- UIBarButtonItem,UIToolBar
- IOS UIToolbar
- IOS UIToolBar
- UIToolBar使用
- struts2 工作原理
- Hadoop基本操作命令
- UINavigationController
- Android如何导入已有的外部数据库
- UINavigationBar
- UIToolbar
- 8. 观察者模式-发布订阅模式
- scala 中map
- emacs常用命令
- NSOperation(操作)简介
- [easyui]封装一个dialog
- MyBatis_延迟加载
- PHP 将连续的汉语拼音分隔开
- 每天0点MySQL弹出黑DOS窗口