Giter Club home page Giter Club logo

github2016-yuan / lsnavigationcontroller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lsmakethebest/lsnavigationcontroller

0.0 1.0 0.0 3.2 MB

导航栏背景色可以统一设置,每一个控制器导航栏背景色还可以自己单独设置不影响统一设置的界面,采用自定义交互动画实现淘宝,京东等软件当下最流行的导航控制器效果,比其他实现方式每一个控制器都包装一个导航控制器性能更好,使用方法更贴合系统使用方法

License: MIT License

Objective-C 100.00%

lsnavigationcontroller's Introduction

LSNavigationController

将文件拖到项目里,想要这种效果的导航控制器继承LSNavigationController

每个VC都有一个UINavigationBar,导航控制器的navigationBar被隐藏

使用此框架适用于frame从0开始算的项目

设置UINavigationBar,UIBarButtonItem 和系统使用方法一样

image

在UIViewController里设置 ,如果有基类直接在基类设置一遍就不用在设置了

`

  • (void)viewDidLoad{

      [super viewDidLoad];
      [self reloadNavigationBar];//创建UINavigationBar 必须在设设置item前面 也可以在基类统一创建
      self.title=@"第一页";
      UIBarButtonItem *item=[[UIBarButtonItem alloc]initWithTitle:@"push" style:(UIBarButtonItemStylePlain) target:self action:@selector(click)];
      self.navigationItem.rightBarButtonItem=item;
      [self.navigationBar setBackgroundImage:[self imageWithColor:[UIColor orangeColor]] forBarMetrics:UIBarMetricsDefault];
    

    }

`

禁用启用侧滑手势 在viewDidLoad里设置即可

@property (nonatomic,assign) BOOL cancelGesture; //取消当前页面手势 不影响其他VC手势使用

禁用启用所有界面侧滑手势

self.navigationController.cancelGesture=YES;//禁用整个导航控制器手势 如果想在启用必须在设置为NO

如果想在当前view上添加一个全屏view覆盖navigationBar

//设置要添加view的view.viewLevel即可 view.viewLevel=UIViewLevelHigh; //然后再addSubview

lsnavigationcontroller's People

Contributors

lsmakethebest avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.