Code Monkey home page Code Monkey logo

chzalertview's Introduction

README

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


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

目录

安装

  1. 使用 Cocoapod
  2. 下载相关代码,引入项目

使用方式


//引入头文件 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

chzalertview's People

Contributors

wymann avatar

Stargazers

RavenDeng avatar  avatar  avatar Schuyler Lee avatar  avatar huchengwenhao avatar  avatar  avatar

Watchers

James Cloos avatar  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.