Git Product home page Git Product logo

jyjslidemenucontroller's Introduction

JYJSlideMenuController

一款不一样的侧滑菜单

GIF

JYJSlideMenuControllerJYJSlideMenuController

message

JYJSlideMenuController 模仿摩拜侧滑导航栏,既然都是共享单车,为什么侧滑菜单不拿出来共享呢

Usage

JYJSlideMenuController 很简单,利用系统的导航栏,带有UIBarButtonItem慢慢出现的效果,省去自定义的麻烦。下来接下来我讲解具体实现大致步骤:

侧滑栏有右半部分是透明的,可以看到下面。经过思考,觉得是窗口window。 设置window的跟控制器为导航控制器window_.rootViewController = nav;.整个过程还是用的系统的导航栏不用自定义

1、添加手势。手势选用很有讲解,仔细观察摩拜,屏幕边缘也有手势,用的就是 UIScreenEdgePanGestureRecognizer,然而有地图的存在,根本不起作用。怎么办呢?解决办法就是实现代理方法

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
UIScreenEdgePanGestureRecognizer *leftEdgeGesture = [[UIScreenEdgePanGestureRecognizer alloc] initWithTarget:self
                                                      action:@selector(moveViewWithGesture:)];
leftEdgeGesture.edges = UIRectEdgeLeft;// 屏幕左侧边缘响应
[self.view addGestureRecognizer:leftEdgeGesture];
// 这里是地图处理方式,遵守代理协议,实现代理方法
leftEdgeGesture.delegate = self;

2、出来之后状态栏的隐藏,这里就很讲究了状态栏慢慢隐藏的。 在info.plist中配置UIViewControllerBasedStatusBarAppearance为YES。 然后在控制器中实现

-(BOOL)prefersStatusBarHidden
-(UIStatusBarAnimation)preferredStatusBarUpdateAnimation 

动画展示隐藏的话需要动画

self.hideStatusBar = YES;
[UIView animateWithDuration:animationTime animations:^{
            [self setNeedsStatusBarAppearanceUpdate];
            self.rootViewController.navigationController.navigationBar.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 64);
}];

联系我

QQ 453255376, 如有bug、不明白的,希望大家踊跃联系我,把程序写的更好。

jyjslidemenucontroller's People

Contributors

jiangyongjian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jyjslidemenucontroller's Issues

不错 已star

写的不错,达到我的要求。我现在也是在写和摩拜一样的效果,用了MMDrawerController 和RESideMenu两个第三方都是不行,都不能从左边VCpush到主VC的。就是能不能写个类似分类一样的直接调用就好了,我现在在研究你的demo,拉进自己项目有点麻烦

点击多次会存在多个相同的 view

[self.view addSubview:vc.view];
当触发 profileCenter 方法 vc.view 这个view会被多次添加 self.view.subviews 里面有多个 相同的 vc.view。
我觉得可以在 closeAnimation 方法后回调移除这个 vc.view

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.