Coder Social home page Coder Social logo

czhalertview's Introduction

CZHAlertView

公司的项目.png

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

ios CZHAlertView 类似系统UIAlertController封装

QQ20180427.gif

项目需要,类似系统的UIAlertController的弹窗,但是按钮文字大小颜色需要自定义,ios8.0版本的手机不支持使用kvc改变,于是就自己写了一个,可以自定义文字大小,显示动画有渐变和从底部弹出以及默认的没有动画效果

///使用很简单,类似系统的
CZHAlertView *alertView = [CZHAlertView czh_alertViewWithTitle:@"哈哈哈哈哈哈哈哈" message:@"啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦" preferredStyle:CZHAlertViewStyleActionSheet animationStyle:CZHAlertViewAnimationStyleSlideFromBottom];
            
            CZHAlertItem *item = [CZHAlertItem czh_itemWithTitle:@"取消" style:CZHAlertItemStyleCancel handler:^(CZHAlertItem *item) {
                NSLog(@"---点击了");
            }];
            
            CZHAlertItem *item1 = [CZHAlertItem czh_itemWithTitle:@"取消2" titleFont:CZHGlobelNormalFont(15) titleColor:CZHColor(0x0000ff) style:CZHAlertItemStyleCancel handler:^(CZHAlertItem *item) {
                NSLog(@"---点击了");
            }];
            
            CZHAlertItem *item2 = [CZHAlertItem czh_itemWithTitle:@"自定义的按钮样式" titleFont:CZHGlobelNormalFont(12) titleColor:CZHColor(0x00ff00) style:CZHAlertItemStyleDefault handler:^(CZHAlertItem *item) {
                NSLog(@"---点击了");
            }];
            
            [alertView czh_addAlertItem:item];
            [alertView czh_addAlertItem:item1];
            [alertView czh_addAlertItem:item2];
            
            [alertView czh_showView];

查看博客 查看简书

czhalertview's People

Contributors

jolincheng avatar

Watchers

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