UIAlertView与UIAlertController
来源:互联网 发布:mac版tomcat下载 编辑:程序博客网 时间:2024/06/05 20:08
UIAlertView是这样用滴:
UIAlertView *alert = [[UIAlertViewalloc]initWithTitle:@"温馨提示"message:@"数据不能为空"delegate:nilcancelButtonTitle:@"确定"otherButtonTitles:nil,nil];
[alert show];
-------------------------------------------------------------------------------------
UIAlertController是这样用滴:
//创建提示框窗口
UIAlertController *alertController = [UIAlertControlleralertControllerWithTitle:@"温馨提示"message:@"信息"preferredStyle:UIAlertControllerStyleAlert];
//实例化取消按钮
UIAlertAction *cancelAction = [UIAlertActionactionWithTitle:@"取消"style:UIAlertActionStyleCancelhandler:^(UIAlertAction *action) {
}];
//实例化确定按钮
UIAlertAction *otherAction = [UIAlertActionactionWithTitle:@"确定"style:UIAlertActionStyleDefaulthandler:^(UIAlertAction *action) {
}];
//向弹出框中添加按钮
[alertController addAction:cancelAction];
[alertController addAction:otherAction];
//将提示框弹出
[selfpresentViewController:alertControlleranimated:YEScompletion:nil];
//添加输入框[alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {
textField.backgroundColor = [UIColorgreenColor];
textField.placeholder =@"输入点什么";
}];
//确定按钮中获得输入的内容UITextField*textfield=alertController.textFields[0];
NSString *str = textfield.text;
NSLog(@"输入的内容:%@",str);
- UIAlertController与 UIAlertView
- 浅谈UIAlertView与UIAlertController
- 浅谈UIAlertView与UIAlertController
- UIAlertView与UIAlertController
- iOS--UIAlertView与UIAlertController和UIAlertAction
- iOS UIAlertController代替代替UIAlertView与UIActionSheet
- UIAlertController的使用(ios9.0后代替UIAlertView与UIActionSheet)
- UIAlertController的用法以及和其与UIAlertView的区别
- IOS开发中UIAlertView与UIAlertController的用法
- UIAlertView 和UIAlertController二合一
- UIAlertView以及UIAlertController
- UIAlertView变成了UIAlertController
- UIAlertView 和 UIAlertController
- UIAlertController(UIActionSheet、UIAlertView)
- UIAlertController & UIAlertView 对话框
- UIAlertController UIAlertAction (UIAlertView, UIActionSheet)
- UIAlertController和UIAlertView
- UIAlertController代替UIAlertView
- SpringMVC里<form>标签报错Neither BindingResult nor plain target object for bean name '***' available as
- 欢迎使用CSDN-markdown编辑器
- java基础之二维数组-杨辉三角
- anaconda
- Appium+java实现自动化测试第一个demo
- UIAlertView与UIAlertController
- HDU 6063 RXD and math(数学 )
- 项目管理工具--Maven 学习笔记
- es6箭头函数
- dubbo注册服务IP解析异常及IP解析源码分析
- ubuntu配置163源和阿里源
- iOS开发中如何在View视图中获取到该视图的控制器
- 基础题目选解_高精度运算(小学生算数,阶乘的精确值,高精度运算类bign)
- codeforces 835C Star sky (二维数组前缀和)