欢迎光临
我们一直在努力

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

建站超值云服务器,限时71元/月

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];
}

查看简书
查看github
查看博客

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » ios弹窗视图,使用block处理点击事件
分享到: 更多 (0)