//
// ?ViewController.m
//彈框
//
// ?Created by lanou on 16/7/13.
// ?Copyright ? 2016年lanou. All rights reserved.
//
//UITextfeild:怎么獲取UITextFielld的文本闷游,怎么設(shè)置輸入框鍵盤類型,設(shè)置占位字符串
#import"ViewController.h"
@interfaceViewController()
@end
@implementationViewController
- (void)viewDidLoad {
[superviewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (IBAction)alertAction:(id)sender {
//彈框:UIAlertConteoller
// ???Title:大標(biāo)題
// ???message:小標(biāo)題
// ???preferredStyle:彈框樣式
UIAlertController*alertController=[UIAlertControlleralertControllerWithTitle:@"你有病"message:@"你有藥啊"preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction*okAction=[UIAlertActionactionWithTitle:@"確定"style:UIAlertActionStyleDefaulthandler:^(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