CHZAlertView 0.0.2

CHZAlertView 0.0.2

[OwenChen] 维护。



  • 作者
  • 陈怀章Wyman

README

弹窗效果封装,支持显示图片、TextField、TextView、tableVeiw选择器等类型,也定时消失。欢迎邮箱反馈


作者 陈怀章Owen
E-mail 1 [email protected]
E-mail 2 [email protected]

目录

使用方法


//引入头文件 NormalAlertVC.h

-(void)startPopAlertView {
    CHZAlertSetup *setup = [[CHZAlertSetup alloc] init];
    setup.sideTap = YES; //点击旁边空白处是否关闭弹窗
    setup.alertType = AlertViewType_Normal;
    setup.animationType = ShowAnimationType_FromLeft; //从左边弹出
    setup.title = @"消息提醒";
    setup.information = @"主人,下午好,有人按了客厅门铃。是否给他开门?";
    setup.icon = [UIImage imageNamed:@"topIcon"];
    CHZAlertButtonItem *item0 = [[CHZAlertButtonItem alloc] initWithTitle:@"取消" titleColor:nil backColor:nil image:nil];
    CHZAlertButtonItem *item1 = [[CHZAlertButtonItem alloc] initWithTitle:@"确定" titleColor:nil backColor:[UIColor redColor] image:nil];
    setup.buttonItemArray = @[item0, item1];
    setup.buttonsShowType = ButtonsShowType_Horizontal;
    CHZAlertView *alertView = [[CHZAlertView alloc] initWithAlertSetup:setup];
    [alertView showAlertView];
    alertView.buttonBlock = ^(NSInteger buttonIndex, NSString *inputText, NSArray<NSString *> *pickedStrings) {
        if (buttonIndex == 0) {
            NSLog(@"点击了 取消");
        } else if (buttonIndex == 1) {
            NSLog(@"点击了 确定");
        }
        return YES; //点击后是否关闭弹窗
    };
}

其他各种样式请下载 Demo 参考以下

效果图(GIF 动图,如果网络条件不好可能会卡,稍等一下就会动了)


普通弹窗

image

图片弹窗

image

TextField弹窗

image

TextView弹窗

image

选择器弹窗

image

倒计时消失弹窗

image