我使用警报控制器创建了一个弹出警报,并添加了两个警报操作(确定和取消),如下所示.
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行.我试过我没有得到如何添加它.
请指教.