IOS开发之 ---- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
2016-08-05 17:49
405 查看
- (void)showOkayCancelAlert { NSString *title = NSLocalizedString(@"A Short Title Is Best", nil); NSString *message = NSLocalizedString(@"A message should be a short, complete sentence.", nil); NSString *cancelButtonTitle = NSLocalizedString(@"Cancel", nil); NSString *otherButtonTitle = NSLocalizedString(@"OK", nil); UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert]; // Create the actions. UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:cancelButtonTitle style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { NSLog(@"The \"Okay/Cancel\" alert's cancel action occured."); }]; UIAlertAction *otherAction = [UIAlertAction actionWithTitle:otherButtonTitle style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { NSLog(@"The \"Okay/Cancel\" alert's other action occured."); }]; // Add the actions. [alertController addAction:cancelAction]; [alertController addAction:otherAction]; [self presentViewController:alertController animated:YES completion:nil]; }
相关文章推荐
- IOS开发之 ---- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- IOS开发之 ---- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- IOS开发之 ---- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- IOS开发之 ---- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- iOS入门编程1--iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- IOS开发之UI——UIAlertView使用
- IOS开发:UIAlertView使用
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- ios iphone开发中使用UIActivityIndicatorView 控件来做等待提示。
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- 关于如何在iOS开发中使用风火轮UIActivityIndicatorView提示加载等待
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- Objective-C ,ios,iphone开发基础:UIAlertView使用详解
- Objective-C ,ios,iphone开发基础:UIAlertView使用详解
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- ios iphone开发中使用UIActivityIndicatorView 控件来做等待提示。
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)