//
// ?ViewController.m
//彈框
//
// ?Created by lanou on 16/7/13.
// ?Copyright ? 2016年lanou. All rights reserved.
//
//UITextField:怎么獲取UITextField的文本,怎么設(shè)置輸入框鍵盤類型,設(shè)置占位字符串颗胡,密文輸入
#import"ViewController.h"
@interfaceViewController()
@end
@implementationViewController
- (void)viewDidLoad {
[superviewDidLoad];
}
- (IBAction)alertAction:(id)sender {
//彈框:UIAlertController
//Title:大標(biāo)題
//message:小標(biāo)題
//preferredStyle:彈框樣式
UIAlertController*alertController = [UIAlertControlleralertControllerWithTitle:@"你有病"message:@"你可以去吃藥了"preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction*okAction = [UIAlertActionactionWithTitle:@"確定"style:UIAlertActionStyleDestructivehandler:^(UIAlertAction*_Nonnullaction) {
//按鈕按下要做的事情
NSLog(@"淮南師范學(xué)院");
}];
//取消
UIAlertAction*cancelAction = [UIAlertActionactionWithTitle:@"取消"style:(UIAlertActionStyleCancel)handler:nil];
//給彈框添加行為
[alertControlleraddAction:okAction];
[alertControlleraddAction:cancelAction];
[selfpresentViewController:alertControlleranimated:YEScompletion:nil];
}
- (void)didReceiveMemoryWarning {
[superdidReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end