UIAlertController 基本用法一

来源:互联网 发布:网络登录用户名和密码 编辑:程序博客网 时间:2024/05/19 01:12



1、定义

UIAlertController* alertController =[UIAlertController alertControllerWithTitle:@"提示"message:@"hello"了"preferredStyle:UIAlertControllerStyleAlert];

2、添加action

[alertController addAction:[UIAlertActionactionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];

3、显示        

[self presentViewController:alertControlleranimated:YES completion:nil];



0 0
原创粉丝点击