分類為UINavigationController集成了許多方便的功能點

cp6p 9年前發布 | 33K 次閱讀 iOS開發 移動開發 UINavigationController

"UINavigationController+JZExtension"分類為UINavigationController集成了許多方便的功能點,同時為它打開了一些隱藏功能。

Features

Overview

overview

Why JZNavigationExtension?

  • Pop Gesture Works Perfect With UITableView【全屏Pop手勢完美匹配UITableView無沖突】
  • Enable or disable property for each view controller conveniently.【簡單地針對每一個Controller開關屬性】
  • Pushes/Pops a view controller when hides/shows navigation bar display soomthly【當控制器做Push/Pop時無縫、平滑地顯隱導航欄】
  • Release some restrictions make your navigation controller stronger【解除一些限制,使你的導航控制器更加強大】
  • Follow Apple's API design principles,uses as natural as system api【遵循Apple Inc的API設計原則,使用就像系統API一樣自然】

Usage

To gives you a fullscreen interactivePopGestureRecognizer【打開全屏Pop手勢】:

navigationController.fullScreenInteractivePopGestureRecognizer = YES;

To hides navigation bar when the view controller is pushed on to a navigation controller【支持轉場隱藏、顯示導航欄】:

UIViewController *viewController = [UIViewController new];
viewController.hidesNavigationBarWhenPushed = YES;
[self.navigationController pushToViewController:viewController animated:YES];

To Push/Pop view controller With blocks【導航控制器轉場回調】:

[self.navigationController pushViewController:viewController animated:YES completion:^(BOOL finished) { ///Do any thing }];

To adjust navigation/tool bar background alpha【調節導航控制器的導航欄、工具條透明度】:

navigationController.navigationBarBackgroundAlpha = yourAlpha;

To change navigation/tool bar size【改變導航控制器的導航欄、工具條大小】:

[navigationController setNavigationBarSize:size];

or you can also change their frame.size manually 【你也可以手動改變它們的frame】

CGRect rect = self.navigationBar.frame;
rect.size = navigationBarSize;
self.navigationBar.frame = rect;

To hide navigation bar background alpha during pop gesture is interactiving

UIViewController *viewController = [UIViewController new];
viewController.navigationBarBackgroundHidden = YES;

overview


Installation

Use cocoapods

pod 'JZNavigationExtension'

Manually

Drag all source files under floder JZNavigationExtension to your project.

UINavigationController+JZExtension.h    UINavigationController+JZExtension.m

項目主頁:http://www.baiduhome.net/lib/view/home/1436104343221

 本文由用戶 cp6p 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!