iOS alertController自带的输入框
2024-08-24 03:25:35
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:@"请输入支付密码" preferredStyle:UIAlertControllerStyleAlert]; //增加取消按钮; [alertController addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { }]]; //增加确定按钮; [alertController addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { //获取第1个输入框; UITextField *userNameTextField = alertController.textFields.firstObject; NSLog(@"支付密码 = %@",userNameTextField.text); }]]; //定义第一个输入框; [alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) { textField.placeholder = @"请输入支付密码"; textField.secureTextEntry = YES; }]; [self presentViewController:alertController animated:true completion:nil];
最新文章
- 完美解决window.navigator.geolocation.getCurrentPosition,在IOS10系统中无法定位问题
- WPF之自定义控件
- fnc.tld学习编写
- 快速入门系列--WebAPI--04在老版本MVC4下的调整
- 创建Maven项目
- C# 使用Trace记录程序日志
- C++ TrieTree(字典树)容器的实现
- 利用 NGINX 最大化 Python 性能,第一部分:Web 服务和缓存
- Xml文件保存值不能及时更新
- STL总结之bitset
- [TypeScript] Generating Definition Files
- How to decompile class file in Java and Eclipse - Javap command example(转)
- Oracle 收集统计信息11g和12C在差异
- poptest交流QQ群
- 微信小程序左滑删除功能
- Acm弱校奋斗史
- 文本分布式表示(二):用tensorflow和word2vec训练词向量
- Mysql的两种偏移量分页写法
- 1.01-url-open_code
- 剑指Offer-- 翻转链表 (python版)
热门文章
- input函数报错";*** is not defined";
- day04 python入门(变量,基本数据类型)
- Windows配置Delve的测试环境
- python 爬虫:HTTP ERROR 406
- scrapy 基础组件专题(二):下载中间件
- disconf原理解析
- 定时器三----js定时器
- Python Ethical Hacking - BACKDOORS(8)
- C++语法小记---面向对象模型(实例的内存分布)
- C++语法小记---前置操作符和后置操作符