【发布时间】:2015-02-19 09:44:51
【问题描述】:
我使用警报控制器创建了一个弹出警报,并添加了两个警报操作(确定和取消),如下所示。
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];
现在,我想添加 UITextView。因为我有两个文本字段,如标题和描述。对于描述,我想使用 UITextView 添加行数。我试过了,我不知道如何添加它。
请指教。
【问题讨论】:
-
不要,使用自定义视图,或者以模态方式呈现的视图控制器。
-
@vikingosegundo 好吧...抱歉。谢谢
标签: ios objective-c uialertcontroller