【发布时间】:2016-02-02 11:48:25
【问题描述】:
我们如何在 iOS 9 中使用UIAlertView 以及如何在UIAlertController 中添加按钮
UIAlertController * alert=[UIAlertController
alertControllerWithTitle:@"Title" message:@"Message"preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* yesButton = [UIAlertAction
actionWithTitle:@"Yes, please"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
**//What we write here????????**
}];
UIAlertAction* noButton = [UIAlertAction
actionWithTitle:@"No, thanks"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
**//What we write here????????**
}];
[alert addAction:yesButton];
[alert addAction:noButton];
[self presentViewController:alert animated:YES completion:nil];
【问题讨论】:
-
你已经添加了两个按钮,在那个//我们在这里写什么????????,你需要处理你需要的任何动作,就是这样所有兄弟,你需要添加更多按钮..
-
那么如何处理那个动作???我不明白:(@Anbu.Karthik
标签: ios objective-c iphone uialertcontroller