【链接】https://github.com/MrJalen/MaxAlertView

MaxAlertView

if (indexPath.section == ) {
[MaxAlertView showAlertWithTitle:@"AlertView show Title"];
}else if (indexPath.section == ) {
[MaxAlertView showAlertWithTitle:@"Title" message:@"AlertView show Title with message"];
}else if (indexPath.section == ) {
[MaxAlertView showAlertWithTitle:@"Title" message:@"AlertView show Title with message" cancelTitle:@"cancel" completion:^(BOOL cancelled) {
NSLog(@"cancel");
}];
}else if (indexPath.section == ) {
[MaxAlertView showAlertWithTitle:@"Title" message:@"AlertView show Title with message" cancelTitle:@"cancel" otherTitle:@"confirm" completion:^(BOOL cancelled) {
if (cancelled) {
NSLog(@"cancel");
}else {
NSLog(@"confirm");
}
}];
}else if (indexPath.section == ) {
[MaxAlertView showAlertWithTitle:@"Title" message:@"AlertView show Title with message" cancelTitle:@"cancel" otherTitle:@"confirm" contentView:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"wode_ydy"]] completion:^(BOOL cancelled) {
if (cancelled) {
NSLog(@"cancel");
}else {
NSLog(@"confirm");
}
}];
}else if (indexPath.section == ) {
[MaxAlertView showAlertWithTitle:@"Title" message:@"AlertView show Title with message" completion:^(BOOL cancelled) {
if (cancelled) {
NSLog(@"ok");
}
}];
}

AlertPopUpView

if (indexPath.section == ) {
PopUpView *popUpView = [[PopUpView alloc] initWithTitle:@"Title" message:@"AlertPopUpView show Title with message"]; [popUpView addBtnWithTitle:@"cancel" type:JLPopUpBtnStyleCancel handler:^{
NSLog(@"cancel");
}]; [popUpView addBtnWithTitle:@"confirm" type:JLPopUpBtnStyleDefault handler:^{
NSLog(@"confirm");
}]; [popUpView showInView:self.view preferredStyle:JLPopUpViewStyleAlert];
}else if (indexPath.section == ) {
PopUpView *popUpView = [[PopUpView alloc] initWithTitle:@"Title" message:@"AlertPopUpView show Title with More button action style" cancelButtonTitle:@"cancel" otherButtonTitles:@[@"one style", @"two style", @"confirm"] actionWithIndex:^(NSInteger index) {
if (index == ) {
NSLog(@"cancel");
}else if (index == ) {
NSLog(@"one style");
}else if (index == ) {
NSLog(@"two style");
}else {
NSLog(@"confirm");
}
}]; [popUpView addBtnWithTitle:@"separate add style" type:JLPopUpBtnStyleDestructive handler:^{
NSLog(@"separate add style");
}]; [popUpView showInView:self.view preferredStyle:JLPopUpViewStyleAlert];
}else if (indexPath.section == ) {
PopUpView *popUpView = [[PopUpView alloc] initWithTitleConfiguration:^(TitleConfiguration *configuration) {
configuration.text = @"Title";
configuration.textColor = [UIColor redColor];
} messageConfiguration:^(MessageConfiguration *configuration) {
configuration.text = @"The ways to create the title and the message of the text, font size, font color, text on the bottom margin customizing, adapted to your requirements at any time";
configuration.fontSize = 15.0;
configuration.textColor = [UIColor purpleColor];
configuration.bottom = 25.0;
}]; [popUpView addBtnWithTitle:@"cancel" type:JLPopUpBtnStyleCancel handler:^{
NSLog(@"cancel");
}]; [popUpView addBtnWithTitle:@"I know" type:JLPopUpBtnStyleDestructive handler:^{
NSLog(@"I know");
}]; [popUpView addBtnWithTitle:@"confirm" type:JLPopUpBtnStyleDefault handler:^{
NSLog(@"confirm");
}];
[popUpView showInView:self.view preferredStyle:JLPopUpViewStyleAlert]; }else {
PopUpView *popUpView = [[PopUpView alloc] initWithTitle:@"Title" message:@"Log in or Sing in"];
__weak typeof(PopUpView) *weakPopUpView = popUpView; [popUpView addTextFieldWithPlaceholder:@"account/phone number/email" text:nil secureEntry:NO];
[popUpView addTextFieldWithPlaceholder:@"password" text:nil secureEntry:YES];
[popUpView addTextFieldWithPlaceholder:@"password again" text:nil secureEntry:YES]; [popUpView addBtnWithTitle:@"cancel" type:JLPopUpBtnStyleCancel handler:^{
NSLog(@"cancel");
}]; [popUpView addBtnWithTitle:@"confirm" type:JLPopUpBtnStyleDefault handler:^{
NSLog(@"confirm");
for (int i = ; i < weakPopUpView.textFieldArray.count; i ++) {
UITextField *tf = weakPopUpView.textFieldArray[i];
NSLog(@"第%d个输入框的文字是:%@", i, tf.text);
}
}];
[popUpView showInView:self.view preferredStyle:JLPopUpViewStyleAlert];
}

ActionSheetPopUpView

if (indexPath.section == ) {
PopUpView *popUpView = [[PopUpView alloc] initWithTitle:@"Title" message:@"AlertPopUpView show Title with message"]; [popUpView addBtnWithTitle:@"cancel" type:JLPopUpBtnStyleCancel handler:^{
NSLog(@"cancel");
}]; [popUpView addBtnWithTitle:@"confirm" type:JLPopUpBtnStyleDefault handler:^{
NSLog(@"confirm");
}]; [popUpView showInView:self.view preferredStyle:JLPopUpViewStyleActionSheet];
}else if (indexPath.section == ) {
PopUpView *popUpView = [[PopUpView alloc] initWithTitle:@"Title" message:@"AlertPopUpView show Title with More button action style" cancelButtonTitle:@"cancel" otherButtonTitles:@[@"one style", @"two style", @"confirm"] actionWithIndex:^(NSInteger index) {
if (index == ) {
NSLog(@"cancel");
}else if (index == ) {
NSLog(@"one style");
}else if (index == ) {
NSLog(@"two style");
}else {
NSLog(@"confirm");
}
}]; [popUpView addBtnWithTitle:@"separate add style" type:JLPopUpBtnStyleDestructive handler:^{
NSLog(@"separate add style");
}]; [popUpView showInView:self.view preferredStyle:JLPopUpViewStyleActionSheet];
}else if (indexPath.section == ) {
PopUpView *popUpView = [[PopUpView alloc] initWithTitleConfiguration:^(TitleConfiguration *configuration) {
configuration.text = @"Title";
configuration.textColor = [UIColor redColor];
} messageConfiguration:^(MessageConfiguration *configuration) {
configuration.text = @"The ways to create the title and the message of the text, font size, font color, text on the bottom margin customizing, adapted to your requirements at any time";
configuration.fontSize = 15.0;
configuration.textColor = [UIColor purpleColor];
configuration.bottom = 25.0;
}]; [popUpView addBtnWithTitle:@"cancel" type:JLPopUpBtnStyleCancel handler:^{
NSLog(@"cancel");
}]; [popUpView addBtnWithTitle:@"I know" type:JLPopUpBtnStyleDestructive handler:^{
NSLog(@"I know");
}]; [popUpView addBtnWithTitle:@"confirm" type:JLPopUpBtnStyleDefault handler:^{
NSLog(@"confirm");
}];
[popUpView showInView:self.view preferredStyle:JLPopUpViewStyleActionSheet];
}else {
PopUpView *popUpView = [[PopUpView alloc] initWithTitle:@"Title" message:@"Log in or Sing in"];
__weak typeof(PopUpView) *weakPopUpView = popUpView; [popUpView addTextFieldWithPlaceholder:@"account/phone number/email" text:nil secureEntry:NO];
[popUpView addTextFieldWithPlaceholder:@"password" text:nil secureEntry:YES];
[popUpView addTextFieldWithPlaceholder:@"password again" text:nil secureEntry:YES]; [popUpView addBtnWithTitle:@"cancel" type:JLPopUpBtnStyleCancel handler:^{
NSLog(@"cancel");
}]; [popUpView addBtnWithTitle:@"confirm" type:JLPopUpBtnStyleDefault handler:^{
NSLog(@"confirm");
for (int i = ; i < weakPopUpView.textFieldArray.count; i ++) {
UITextField *tf = weakPopUpView.textFieldArray[i];
NSLog(@"第%d个输入框的文字是:%@", i, tf.text);
}
}];
[popUpView showInView:self.view preferredStyle:JLPopUpViewStyleActionSheet];
}

效果图

 

 

版权声明:本文为博主原创文章,未经博主允许不得转载。

MaxAlertView 强大的弹框试图的更多相关文章

  1. ext4.2常用的几种弹框

    以下记录了自己在做项目时,经常用到的几种ext弹框.项目中使用的ext是4.2版本的. 1. Ext.Msg.alert() 使用此种方式时,如果提示信息过长则提示信息会被覆盖掉一部分. Ext.Ms ...

  2. 考拉Android统一弹框

    作者:钱成杰 背景 在快速开发的背景下,经历了n个版本后的考拉Android App中已经存在了各种各样看似相同却各有差别的弹框样式.其中包括系统弹框和自定义弹框,并且在线上时常会出现IllegalA ...

  3. 参考bootstrap中的popover.js的css画消息弹框

    前段时间小颖的大学同学给小颖发了一张截图,图片类似下面这张图: 小颖当时大概的给她说了下,其实小颖也不知道上面那个三角形怎么画嘻嘻,给她说了DOM结构,具体的css让她自己百度,今天小颖自己参考boo ...

  4. 安卓客户端a标签长按弹框提示解决办法

    昨天工作时候发现一个bug,是关于a标签的,在安卓客户端中,如果是a标签的话,长按会出现一个弹框,如图所示 是因为安卓客户端的长按触发机制,以后进行wap端开发的时候,如果用到跳转页面尽量不要用a标签 ...

  5. Jquary入门(添加 修改 表单元素)+ JSON+弹框

    字符串拼接 计算机语言 都是 对  数据的处理(获取/修改数据)  添加元素  除了  固定的方法添加 以外 都是   字符串拼接(拼接成固定格式即可执行). 1.表单添加元素  append() 方 ...

  6. ios UIWebView自定义Alert风格的弹框

    之前开发过一个App,因为公司之前写好了网页版的内容和安卓版本的App,我进去后老板要求我ios直接用网页的内容,而不需要自己再搭建框架.我一听,偷笑了,这不就是一个UIWebView吗?简单! 但是 ...

  7. weui 弹框中的单选效果

    <!--性别修改弹框--> <div class="weui_dialog_alert" id="doctorSexDialog" style ...

  8. showPrompt弹框提示

    工作中会有很多的弹框,用来添加模板,用来信息提示,,我现在用的模板有dialog(用来添加数据模板内容),还有一个就是自写的showPrompt用来判断错误或者正确的信息~~ 样子大概就是这样的,, ...

  9. 弹框控件 UIAlertView UIActionSheet

    // 创建弹框 从底部弹出,一般用于危险操作 UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"恭喜通关" ...

随机推荐

  1. 20155239 2017-11-19 实现mypwd(选做,加分)

    20155239 2017-11-19 实现mypwd(选做,加分) 题目和要求 学习pwd命令 研究pwd实现需要的系统调用(man -k; grep),写出伪代码 实现mypwd 测试mypwd ...

  2. wpf mediakit 摄像头截图

    原文:wpf mediakit 摄像头截图 在用VideoCaptureElement的过程中,不知道怎么获得摄像头的截图,纠结了整整一天, 最终在下面的网站上找到了答案,哈哈.(困的都不清醒的大脑, ...

  3. 2_C语言中的数据类型 (七)类型限定

    1.1       类型限定 1.1.1          const const是代表一个不能改变值的常量 1.1.2          volatile 代表变量是一个可能被CPU指令之外的地方改 ...

  4. 网络知识 ACL NAT IPv6

    第1章 ACL 访问控制列表 访问控制表(Access Control List,ACL),又称存取控制串列,是使用以访问控制矩阵为基础的访问控制方法,每一个对象对应一个串列主体. 访问控制表描述每一 ...

  5. 如何打war包和jar包

    1.jar包的导出 答:右键项目,export—jarfile  生成. 2.war包的导入 答:方法一:右键项目,export—WAR file 生成. 方法二:[ant文件]—[deploy-be ...

  6. mybatis学习(一)-------XML 映射配置文件详解

    XML 映射配置文件 MyBatis 的配置文件包含了会深深影响 MyBatis 行为的设置(settings)和属性(properties)信息.文档的顶层结构如下: configuration 配 ...

  7. SpringBoot日记——SpringMvc自动配置与扩展篇

    为了让SpringBoot保持对SpringMVC的全面支持和扩展,而且还要维持SpringBoot不写xml配置的优势,我们需要添加一些简单的配置类即可实现: 通常我们使用的最多的注解是: @Bea ...

  8. 【坚持】Selenium+Python学习记录 DAY9

    2018/05/29 [来源:菜鸟教程](http://www.runoob.com/python3/python3-examples.html) 运算符重载 https://segmentfault ...

  9. Python科学测量与计算库Pymeasure: 控制你的仪器进行自动测试和科学计算

    Python这种脚本语言因其语法简单,工具包丰富成熟,使用起来非常方便.在很多领域被广泛使用,今天介绍的是python在仪器控制应用领域,python在仪器控制领域相关的书籍可以参考<真实世界的 ...

  10. 1分钟入门接口自动化框架Karate

    介绍 在这篇文章中,我们将介绍一下开源的Web-API自动化测试框架——Karate Karate是基于另一个BDD测试框架Cucumber来建立的,并且共用了一些相同的思想.其中之一就是使用Gher ...