对话框UIAlertView
来源:互联网 发布:剑三冷艳毒姐捏脸数据 编辑:程序博客网 时间:2024/06/10 13:09
对话框学习UIAlertView当一个control中有多个alertdialog的时候,绑定alertdialog的tag来区分不同的alertdialog#import "ViewController.h"@interface ViewController () <UIAlertViewDelegate>- (IBAction)showAlertDialog;- (IBAction)showActionSheet;@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad];}- (IBAction)showAlertDialog{ /** * 对话款展示 */ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"普通对话框标题" message:@"message" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; [alert show];}- (IBAction)showActionSheet{ /** 弹出警告对话框 cancelButtonTitle取消按钮始终在最下面 destructiveButtonTitle 比较危险的操作都用这个按钮,比如按钮 : “是” 吗? */ UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"标题栏" delegate:self cancelButtonTitle:@"cancel" destructiveButtonTitle:@"cancel discriptio" otherButtonTitles:@"sure", nil]; [sheet showInView:self.view];}- (IBAction)showActionSheet:(id)sender {}/** * 点击按钮的监听器,判断用户点击了哪个按钮 */- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ switch (buttonIndex) { case 0: NSLog(@"00000"); break; case 1: NSLog(@"1111"); break; default: break; }}@end继续补充 UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"数据展示" message:message delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil]; alert.alertViewStyle = UIAlertViewStylePlainTextInput; UIAlertView补强:1、自身带有可用的输入框,不用自己在addsubview2、这里学习一个自学的方法,既然有一个文本输入框,那肯定有获取输入框的方法,通过UITextField就能找到对应的方法,这是自学能力3、通过索引获取输入框:UITextField *textField = [alert textFieldAtIndex:0]4、确定,取消按钮监听通过代理:#pragma mark - alertview代理- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ }
0 0
- 对话框UIAlertView
- IOS-- UIAlertView(对话框)
- UIAlertController & UIAlertView 对话框
- 用UIAlertView绘制弹出对话框
- 模仿UIAlertView,iOS模式对话框
- Android仿IOS UIAlertView对话框
- Android仿IOS UIAlertView对话框
- Android仿IOS UIAlertView对话框
- Android仿IOS UIAlertView对话框
- iOS开发 对话框UIActionSheet和UIAlertView用法
- iOS开发 对话框UIActionSheet和UIAlertView用法
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- UIAlertView
- Linux互斥与同步应用(五):system V信号量的互斥与同步
- 图片滚动器全部代码
- iPhone6 和iPhone6plus 快速适配
- www.chinaphonesale.com90213
- C++标准库---stack
- 对话框UIAlertView
- Linux添加环境变量和Django自动切换配置文件版本
- 代理模式
- Lisp学习笔记(一)
- Lisp学习笔记(三)
- UITableView
- Lisp学习笔记(二)
- IOS状态栏
- lua + libuv 的坑与爽