Skip to content

wyb520/LCNavigationController

 
 

Repository files navigation

LCNavigationController

除 UINavigationController 外最流行的 NavigationController!

image

image

心有猛虎,细嗅蔷薇。

前言 Foreword

效果参考 App:腾讯新闻、百度音乐等等

配合UITabBarController使用请参考 tabbar 分支!

效果图:

image

代码 Code

当成UINavigationController来用就行!方法都一样!

配合UITabBarController使用请参考 tabbar 分支!

    • 方法一:CocoaPods 导入:pod 'LCNavigationController'
    • 方法二:导入LCNavigationController文件夹到你的项目中 (文件夹在 Demo 中可以找到)
  • AppDelegate.m中,#import "LCNavigationController.h",参考如下代码:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        
        self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
        [self.window makeKeyAndVisible];
        
        UIViewController *mainVC = [UIStoryboard storyboardWithName:@"Main" bundle:nil].instantiateInitialViewController;
        
        LCNavigationController *navC = [[LCNavigationController alloc] initWithRootViewController:mainVC];
        
        self.window.rootViewController = navC;
        
        return YES;
    }
  • 在你需要用到的地方#import "LCNavigationController.h",然后:

    // 1. Push
    UIViewController *childVC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"TwoVC"];
    [self.lcNavigationController pushViewController:childVC];
    
    // 2. Pop
    [self.lcNavigationController popViewController];
    
    // 3. Pop to rootViewController
    [self.lcNavigationController popToRootViewController];
  • 可自定义的参数(在LCNavigationController.m中):

    static const CGFloat LCAnimationDuration = 0.50f;   // Push / Pop 动画持续时间
    
    static const CGFloat LCMaxBlackMaskAlpha = 0.80f;   // 黑色背景透明度
    
    static const CGFloat LCZoomRatio         = 0.90f;   // 后面视图缩放比
    
    static const CGFloat LCShadowOpacity     = 0.80f;   // 滑动返回时当前视图的阴影透明度
    
    static const CGFloat LCShadowRadius      = 8.00f;   // 滑动返回时当前视图的阴影半径
  • 搞定!

更新日志 2015.11.24 Update Logs (Tag: 1.0.2 branch: tabbar)

  • 提供配合UITabBarController使用的 Demo,详见 tabbar 分支。

更新日志 2015.11.23 Update Logs (Tag: 1.0.2)

  • 更新自定义参数。

更新日志 2015.11.20 Update Logs (Tag: 1.0.0)

  • 初始化提交。

联系 Support

授权 License

本项目采用 MIT license 开源,你可以利用采用该协议的代码做任何事情,只需要继续继承 MIT 协议即可。

About

除 UINavigationController 外最流行的 NavigationController!

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Objective-C 96.5%
  • Ruby 3.5%