输入文本框设置

今天就给大家分享个简单的输入文本框吧!!!欢迎大家给意见,后续精彩继续更新中。

 

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"标题" message:nil

 preferredStyle:UIAlertControllerStyleAlert];

    _progressText.placeholder = @"占位符";

    

    [alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {

        textField.placeholder = _progressText.placeholder;

        textField.keyboardType = UIKeyboardTypeDefault;

        _progressText = textField;

    }];

    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {

        return ;

    }];

    

    UIAlertAction *otherAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {

        //要做的事情

    }];

       [alertController addAction:cancelAction];

    [alertController addAction:otherAction];

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

 

posted @ 2016-08-18 09:20  Ruby_Hua  阅读(347)  评论(0编辑  收藏  举报