码迷,mamicode.com
首页 > 其他好文 > 详细

UIkit框架之uUInavigationController

时间:2016-07-30 12:03:39      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:

1.继承链:UIviewcontroller:uiresponder:NSObject

2.如果你想使用一些动画转换,可以遵守 UINavigationControllerDelegate

3.创建导航控制器:

    (1)- (instancetype)initWithRootViewController:(UIViewController *)rootViewController  :使用系统默认的导航栏和工具栏,通过一个根视图创建导航控制器

    (2)- (instancetype)initWithNavigationBarClass:(Class)navigationBarClass
                              toolbarClass:(Class)toolbarClass
  :通过一个自定义的导航栏和工具栏创建导航控制器

4.访问导航栈的item

    (1)@property(nonatomicreadonlystrongUIViewController *topViewController  :返回栈顶的controller

    (2)@property(nonatomicreadonlystrongUIViewController *visibleViewController  :返回显示的controller

    (3)@property(nonatomiccopyNSArray <__kindof UIViewController *> *viewControllers  :返回堆栈中所有的controller

    (4)- (void)setViewControllers:(NSArray<UIViewController *> *)viewControllers
                  animated:(BOOL)animated
  :设置管理的视图控制器

5.推出和压进栈item

    (1)- (void)pushViewController:(UIViewController *)viewController
                  animated:(BOOL)animated
  :压入新的视图控制器

    (2)- (UIViewController *)popViewControllerAnimated:(BOOL)animated  :弹出一个视图控制器 返回的是栈顶的controller 

    (3)- (NSArray<__kindofUIViewController *> *)popToRootViewControllerAnimated:(BOOL)animated  :rootviewcontroller将会成为栈顶视图,返回所有的视图

    (4)- (NSArray<__kindofUIViewController *> *)popToViewController:(UIViewController *)viewController
                                                    animated:(BOOL)animated
  :弹出到某个视图控制器 返回所有弹出的controller

    (5)@property(nonatomicreadonlyUIGestureRecognizer *interactivePopGestureRecognizer  :iOS7之后,在导航中右划会进行pop操作,设置这个的enable可以控制设置手势是否失效 

6.配置导航条

    (1)@property(nonatomicreadonlyUINavigationBar *navigationBar  :导航栏对象,只读属性

    (2)- (void)setNavigationBarHidden:(BOOL)hidden
                      animated:(BOOL)animated
  :设置隐藏导航栏

7.配置自定义的工具栏

    (1)@property(nonatomicreadonlyUIToolbar *toolbar  :获取工具栏对象

    (2)- (void)setToolbarHidden:(BOOL)hidden
                animated:(BOOL)animated
  :隐藏工具栏

    (3)@property(nonatomicgetter=isToolbarHiddenBOOL toolbarHidden  :隐藏工具栏

8.隐藏导航条

    (1)@property(nonatomicreadwriteassignBOOL hidesBarsOnTap  :敲击屏幕可以隐藏与显示导航栏

    (2)@property(nonatomicreadwriteassignBOOL hidesBarsOnSwipe  :屏幕滑动的时候隐藏导航栏,常用于tableView,上滑隐藏导航栏,下滑显示,带动画效果

    (3)@property(nonatomicreadwriteassignBOOL hidesBarsWhenVerticallyCompact  :横屏的时候隐藏导航栏

    (4)@property(nonatomicreadwriteassignBOOL hidesBarsWhenKeyboardAppears  :当键盘出现的时候隐藏导航条

    (5)@property(nonatomicgetter=isNavigationBarHiddenBOOL navigationBarHidden  :隐藏导航条

    (6)@property(nonatomicreadonlyassignUITapGestureRecognizer *barHideOnTapGestureRecognizer  :获取敲击屏幕的手势

    (7)@property(nonatomicreadonlystrongUIPanGestureRecognizer *barHideOnSwipeGestureRecognizer  :获取滑动屏幕的手势

    (8)@property(nonatomicweakidUINavigationControllerDelegate delegate  :设置委托

9.显示viewcontroller的动作方法

    (1)- (void)showViewController:(UIViewController *)vc
                    sender:(id)sender
  :这个方法是为了iOS方法的命名统一,在导航中,其作用和push一样

UIkit框架之uUInavigationController

标签:

原文地址:http://www.cnblogs.com/lelun/p/5720516.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!