zoukankan      html  css  js  c++  java
  • iOS 自己写的对话框中加入三个输入框

    -(void)dialog:(NSString*)title okTitle:(NSString*)okTitle placeholder:(NSString*)placeholder finish:(UIAlertControllerSuccess)finish {

        UIAlertController* alert = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleAlert];

        UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:okTitle style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

    //        UITextField* edictTextField = alert.textFields[0];

    //        DLOG(@"点击了ok %@", edictTextField.text);

            finish(1, alert.textFields);

        }];

        

        UIAlertAction* cancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

            [alert dismissViewControllerAnimated:YES completion:nil];

            finish(0, alert.textFields);

    //        UITextField* edictTextField = alert.textFields[0];

    //        DLOG(@"点击了cancel %@", edictTextField.text);

        }];

        

        [alert addAction:defaultAction];

        [alert addAction:cancel];

        [alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {

            textField.placeholder = @"输入1";

        }];

        [alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {

            textField.placeholder = @"输入2";

        }];

        [alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {

            textField.placeholder = @"输入3";

        }];

        

        [self presentViewController:alert animated:YES completion:nil];

    }

     
     
     
  • 相关阅读:
    深信服入职前编码训练21题--02
    深信服入职前编码训练21题--01
    Leetcode本地阅读器开发--01界面设计三
    Leetcode本地阅读器开发--01界面设计二
    Leetcode本地阅读器开发--01界面设计一
    使用DDMS测试安卓手机APP的性能(android)
    在PC上测试移动端网站和模拟手机浏览器的5大方法
    SeleniumIDE与eclipse如何连接使用
    Selenium RC配置
    Selenium IDE- 不同的浏览器
  • 原文地址:https://www.cnblogs.com/careerman/p/11870679.html
Copyright © 2011-2022 走看看