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];

    }

     
     
     
  • 相关阅读:
    select在各个浏览器中的兼容性问题
    pc打开手机站提示切换为手机屏幕
    图片预加载
    div盒子水平垂直居中的方法
    如何检测该浏览器为微信浏览器
    小箭头的写法,z-index在ie7显示混乱问题
    微信a标签不跳转
    css font简写规则
    windows环境cmd下执行jar
    docker制作镜像步骤
  • 原文地址:https://www.cnblogs.com/careerman/p/11870679.html
Copyright © 2011-2022 走看看