Giter Site home page Giter Site logo

zjinhu / jhdropdownview Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 1.65 MB

导航栏下方下拉菜单,可以遮盖住tabbar,但是遮盖上方的视图以及导航栏不影响点击

License: MIT License

Ruby 22.92% Objective-C 72.78% Shell 4.30%
uitabbarcontroller uitabbar uinavigationbar dropdown dropdown-menus popover

jhdropdownview's Introduction

JHDropDownView

实现导航栏下方下拉菜单,可以遮盖住tabbar,但是遮盖上方的视图以及导航栏不影响点击。

##API

//弹出遮罩
+ (void)coverTabbar:(UIView *)contentView       ///需要弹出的菜单视图
              fromY:(CGFloat)fromY              ///菜单弹出的起始坐标
           canClick:(BOOL)canClick              ///是否能点击蒙版收起
          showBlock:(dispatch_block_t)showBlock ///已显示的block
          hideBlock:(dispatch_block_t)hideBlock;///隐藏的block
//判断时候已经存在遮罩
+ (BOOL)hasDropDown;
/**
 隐藏视图
 */
+ (void)hideDropDown;

##使用方法

使用方法,弹出下拉菜单前可以先判断是否存在

    if ([JHDropDownView hasDropDown]) {
        [JHDropDownView hideDropDown];
        return;
    }
    
初始化一个你需要弹出来的菜单并设置size

    UIView *imgView = [[UIView alloc] init];
    imgView.backgroundColor = [UIColor cyanColor];
    imgView.jh_size = CGSizeMake(SCREEN_WIDTH, 300);
    
使用类方法展示遮盖,并且回调给两个block方便执行你的操作,也可以不用

    [JHDropDownView coverTabbar:imgView fromY:起点坐标Y canClick:YES
                      showBlock:^{
                          NSLog(@"show");
                      }
                      hideBlock:^{
                          NSLog(@"hide");
                      }];

##  安装
### 1.手动添加:<br>
*   1.将 JHDropDownView 文件夹添加到工程目录中<br>
*   2.导入 JHDropDownView.h

### 2.CocoaPods:<br>
*   1.在 Podfile 中添加 pod 'JHDropDownView'<br>
*   2.执行 pod install 或 pod update<br>
*   3.导入 JHDropDownView.h



##  许可证
JHDropDownView 使用 MIT 许可证,详情见 LICENSE 文件

jhdropdownview's People

Contributors

zjinhu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

azuredark

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.