MaxAlertView 强大的弹框试图
【链接】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 强大的弹框试图的更多相关文章
- ext4.2常用的几种弹框
以下记录了自己在做项目时,经常用到的几种ext弹框.项目中使用的ext是4.2版本的. 1. Ext.Msg.alert() 使用此种方式时,如果提示信息过长则提示信息会被覆盖掉一部分. Ext.Ms ...
- 考拉Android统一弹框
作者:钱成杰 背景 在快速开发的背景下,经历了n个版本后的考拉Android App中已经存在了各种各样看似相同却各有差别的弹框样式.其中包括系统弹框和自定义弹框,并且在线上时常会出现IllegalA ...
- 参考bootstrap中的popover.js的css画消息弹框
前段时间小颖的大学同学给小颖发了一张截图,图片类似下面这张图: 小颖当时大概的给她说了下,其实小颖也不知道上面那个三角形怎么画嘻嘻,给她说了DOM结构,具体的css让她自己百度,今天小颖自己参考boo ...
- 安卓客户端a标签长按弹框提示解决办法
昨天工作时候发现一个bug,是关于a标签的,在安卓客户端中,如果是a标签的话,长按会出现一个弹框,如图所示 是因为安卓客户端的长按触发机制,以后进行wap端开发的时候,如果用到跳转页面尽量不要用a标签 ...
- Jquary入门(添加 修改 表单元素)+ JSON+弹框
字符串拼接 计算机语言 都是 对 数据的处理(获取/修改数据) 添加元素 除了 固定的方法添加 以外 都是 字符串拼接(拼接成固定格式即可执行). 1.表单添加元素 append() 方 ...
- ios UIWebView自定义Alert风格的弹框
之前开发过一个App,因为公司之前写好了网页版的内容和安卓版本的App,我进去后老板要求我ios直接用网页的内容,而不需要自己再搭建框架.我一听,偷笑了,这不就是一个UIWebView吗?简单! 但是 ...
- weui 弹框中的单选效果
<!--性别修改弹框--> <div class="weui_dialog_alert" id="doctorSexDialog" style ...
- showPrompt弹框提示
工作中会有很多的弹框,用来添加模板,用来信息提示,,我现在用的模板有dialog(用来添加数据模板内容),还有一个就是自写的showPrompt用来判断错误或者正确的信息~~ 样子大概就是这样的,, ...
- 弹框控件 UIAlertView UIActionSheet
// 创建弹框 从底部弹出,一般用于危险操作 UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"恭喜通关" ...
随机推荐
- Spring第二天——IOC注解操作与AOP概念
大致内容 spring的bean管理(注解实现) AOP原理 log4j介绍 spring整合web项目的演示 一.spring注解实现bean管理 注解: 代码中一些特殊的标记,使用注解也可以完成一 ...
- PosgreSQL 9.0 High Performance中文版瑕疵
磨砺技术珠矶,践行数据之道,追求卓越价值 回到上一级页面: PostgreSQL杂记页 回到顶级页面:PostgreSQL索引页 发表此文不是为了吐槽,而是为了防止更多的受害者出现啊,拿到书后 ...
- 标准输入输出 sys.stdin与sys.stdin
1.python中的标准输入输出 如果需要更好的控制输出,而print不能满足需求,input也不能 sys.stdout,sys.stdin,sys.stderr就是你需要的. 2.输入:sys.s ...
- 洛咕 P3306 [SDOI2013]随机数生成器
洛咕 P3306 [SDOI2013]随机数生成器 大力推式子??? \(X_{i}=\underbrace{a(a(\cdots(a(a}_{i-1个a}X_1+b)))\cdots)\) \(=b ...
- python之shutil模块详解
shutil模块 -- --High-level file operations 高级的文件操作模块. os模块提供了对目录或者文件的新建/删除/查看文件属性,还提供了对文件以及目录的路径操作.比如 ...
- 干货分享:五大最适合学习AI开发的编程语言
AI(人工智能)为应用开发者开创了一个全新的可能性.通过利用机器学习或深度学习,您可以生成更好的用户配置文件.个性化设置和推荐,或者整合更智能的搜索.语音界面或智能助手,或者以其他数种方式改进您的应用 ...
- Qt-网易云音乐界面实现-2 红红的程序运行图标,和相似下方音乐条
被调出来出差了,这次出差可以说是非常不开心,这次出差也算给我自己提了个醒吧,那就是注意自己的精力,自己的口碑,和比人对自己的信任.具体内容如下 我们公司有一款硬件的设备的电路是外包给某个人来做的,这个 ...
- Ubuntu安装Oh My Zsh
1. 安装ZSH sudo apt-get install zsh 安装完后需要注销或重启才能生效.注销或重启后打开终端,会出现ZSH的界面,选择(2) 2. 安装Oh My Zsh sh -c &q ...
- C# 通过copydata实现进程间通信
最近公司需要实现一个基于copydata进程间通信的功能.原来一直没有接触过Windows的进程通信,这次正好可以学习一下. 程序是基于Winform的,下面直接上代码. 公共类: public cl ...
- Linux——CentOS7添加/删除用户和用户组(学习笔记)
1.新建用户 adduser testuser //新建testuser 用户 passwd testuser //给testuser 用户设置密码 2.建工作组 groupadd testgroup ...