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

    }

     
     
     
  • 相关阅读:
    CF 990A. Commentary Boxes【数学/模拟】
    HDU 变形课 1181【DFS/BFS】
    HDU 1180 诡异的楼梯【BFS/楼梯随时间变化】
    牛客网 小白赛4 A三角形【贪心】
    POJ 2251 Dungeon Master【三维BFS模板】
    Poj 1236 Network of Schools (Tarjan)
    Poj 2186 Popular Cows (Tarjan)
    Hdu 5285 wyh2000 and pupil (bfs染色判断奇环) (二分图匹配)
    搜索专题题解
    Light 1289
  • 原文地址:https://www.cnblogs.com/careerman/p/11870679.html
Copyright © 2011-2022 走看看