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];
}]];
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];
}]];
相关文章推荐
- IOS中如何在多层界面之间显示与隐藏标签栏(UITabBar)
- Ireport Error retrieving field value from bean : ate045
- 9.UICollectionView增强
- org.hibernate.HibernateException: createSQLQuery is not valid without active transaction
- 225. Implement Stack using Queues
- 8.UIVollectionView
- 6.UITableView增强
- 5.UITableView使用 / 数据源 & 代理 / 行高 / TableViewCell 重用 / 索引栏
- 4.ScrollView常用属性,常用代理方法,图片轮播器,UIAlertView/UIActionSheet
- Bctf-pwn_ruin-re_lastflower
- win8 &win10系统下Guest 帐号本地主机登录
- skcatSgnisueueuQtnemelpmI.232
- iOS开发——UIImageView
- UITableView分割线从边框顶端开始
- Android Activity.runOnUiThread() 和 Handler
- 【学渣笔记】Xitrum Scala Web Framework Guide
- iOS UITableCell复用
- UIImageView的ContentMode属性
- Process 'command '**/ndk-build.cmd'' finished with non-zero exit value 1
- UIView的layoutSubviews和drawRect