您的位置:首页 > 产品设计 > UI/UE

UIAlertController的简单使用

2016-03-23 11:26 537 查看
在iOS9.0以后,UIAlertView已经被弃用。下面介绍一下UIAlertController

UIAlertController*alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"登录失败,用户名或者密码错误!" preferredStyle: UIAlertControllerStyleAlert];
//设置字体颜色
alert.view.tintColor=[UIColor redColor];
//确定
[alert addAction:[UIAlertActionactionWithTitle:@"确定" style:UIAlertActionStyleDefaulthandler:^(UIAlertAction * _Nonnull action) {

}]];

//弹出提示框;

[self presentViewController:alert animated:true completion:nil];

}]];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: