Coder Social home page Coder Social logo

czhpopupview's Introduction

CZHPopUpView

公司的项目.png

公司的项目,求支持,如果发现什么问题,可以留言反应,感激不尽

ios弹窗视图,使用block处理点击事件

QQ20180425-213551-HD---.gif

很简单的弹窗视图控件,可以设置箭头方向在视图的上下左右,可以自定义视图背景颜色,判断视图超出屏幕自动改变位置

使用很简单,默认白色背景箭头在上面

- (IBAction)leftTop:(UIButton *)sender {
    
    CGPoint point = CGPointMake(sender.czh_centerX, sender.czh_centerY + CZH_ScaleWidth(20));
    
    CZHPopUpView *view = [CZHPopUpView czh_popUpWithPoint:point arrowOffset:CZH_ScaleWidth(150)];
    
    [view czh_addItemWithImageName:@"" title:@"点击左上" clickHandler:^(CZHPopUpItem *item) {
        NSLog(@"点击左上");
    }];
    
    [view czh_addItemWithImageName:@"person_data_add_black" title:@"拉黑" clickHandler:^(CZHPopUpItem *item) {
        NSLog(@"点击拉黑");
    }];
    
    
    [view czh_addItemWithImageName:@"person_data_report" title:@"投诉" clickHandler:^(CZHPopUpItem *item) {
        NSLog(@"点击投诉");
    }];
    
    [view czh_showView];
}

自定义颜色和箭头方向
- (IBAction)left:(UIButton *)sender {
    
    CGPoint point = CGPointMake(sender.czh_centerX - CZH_ScaleWidth(20), sender.czh_centerY);
    
    CZHPopUpView *view = [CZHPopUpView czh_popUpWithPoint:point arrowOffset:CZH_ScaleWidth(0) directionType:CZHPopUpViewDirectionTypeRight];
    
    [view czh_addItemWithImageName:@"" title:@"点击左上" clickHandler:^(CZHPopUpItem *item) {
        NSLog(@"点击左上");
    }];
    
    [view czh_addItemWithImageName:@"person_data_add_black" title:@"拉黑" clickHandler:^(CZHPopUpItem *item) {
        NSLog(@"点击拉黑");
    }];
    [view czh_addItemWithImageName:@"person_data_report" title:@"投诉" clickHandler:^(CZHPopUpItem *item) {
        NSLog(@"点击投诉");
    }];
    [view czh_addItemWithImageName:@"person_data_report" title:@"投诉" clickHandler:^(CZHPopUpItem *item) {
        NSLog(@"点击投诉");
    }];
    [view czh_addItemWithImageName:@"person_data_report" title:@"投诉" clickHandler:^(CZHPopUpItem *item) {
        NSLog(@"点击投诉");
    }];
    [view czh_addItemWithImageName:@"person_data_report" title:@"投诉" clickHandler:^(CZHPopUpItem *item) {
        NSLog(@"点击投诉");
    }];
    [view czh_addItemWithImageName:@"person_data_report" title:@"投诉" clickHandler:^(CZHPopUpItem *item) {
        NSLog(@"点击投诉");
    }];
    [view czh_showView];
}

查看博客 查看简书

czhpopupview's People

Contributors

jolincheng 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.