zoukankan      html  css  js  c++  java
  • iOS alertController自带的输入框

    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];
    对上述的代码,有任何疑问,可以在下方留言。 也可以给我发邮件咨询:673658917@qq.com 或者是直接加qq:673658917 转载请注明出处,谢谢合作。 睡觉舒服,那是给死人准备的,加油吧,一年后你会感谢现在的自己的。
  • 相关阅读:
    Oracle 常用的十大 DDL 对象
    Oracle DML
    Oracle 的常用概念
    Spring 4 : 整合 SSH
    Spring3 (事务管理)
    Spring2
    Spring 学习笔记一
    Xpath helper下载
    爬取链家北京市二手房的单个房源页信息
    爬取链家北京市二手房的链家编号
  • 原文地址:https://www.cnblogs.com/lishanshan/p/10107768.html
Copyright © 2011-2022 走看看