相关疑难解决方法(0)

如何在UIAlertController中使用UITextView

我使用警报控制器创建了一个弹出警报,并添加了两个警报操作(确定和取消),如下所示.

UIAlertController * alert=   [UIAlertController
                              alertControllerWithTitle:@"Cycling"
                              message:@"Please enter title and description"
                              preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction* ok = [UIAlertAction
                     actionWithTitle:@"OK"
                     style:UIAlertActionStyleDefault
                     handler:^(UIAlertAction * action)
                     {
                         [alert dismissViewControllerAnimated:YES completion:nil];

                     }];
UIAlertAction* cancel = [UIAlertAction
                         actionWithTitle:@"Cancel"
                         style:UIAlertActionStyleDefault
                         handler:^(UIAlertAction * action)
                         {
                             [alert dismissViewControllerAnimated:YES completion:nil];

                         }];

[alert addAction:ok];
[alert addAction:cancel];

[self presentViewController:alert animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)

现在,我想添加UITextView.因为我有两个文本字段,如标题和描述.为了描述我想使用UITextView添加no.of行.我试过我没有得到如何添加它.

请指教.

objective-c ios uialertcontroller

8
推荐指数
6
解决办法
2万
查看次数

标签 统计

ios ×1

objective-c ×1

uialertcontroller ×1