彈框

//

// ?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

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • // // ViewController.m // 彈框 // // Created by lanou on 16...
    墨染傾閱讀 312評論 0 0
  • 自從iOS9出來之后,需要使用UIAlertController來彈出彈框,不在提倡使用UIAlertView了,...
    南京楊小兵閱讀 627評論 1 0
  • // // ViewController.m //彈框 // // Created by lanou on 16/...
    空氣里的天然呆閱讀 296評論 0 0
  • // // ViewController.m // 彈框 // // Created by lanou on 16...
    丫丫丫丫丫0802閱讀 258評論 0 0
  • 2017-03-24 晴朗 工作 沒拍 【早餐】6:30 蘋果 【午餐】12:13 提子、雙皮奶diy 【下午茶】...
    carmenMP閱讀 181評論 0 0

友情鏈接更多精彩內(nèi)容