'UIAlertView' is deprecated的解决例子
来源:互联网 发布:义隆单片机 图书 编辑:程序博客网 时间:2024/05/20 05:45
如下代码,
UIAlertView *alertView=[[UIAlertView alloc]initWithTitle:@"提示" message:@"恭喜你答对了" delegate:nil cancelButtonTitle:@"点击取消" otherButtonTitles:nil]; [alertView show];
会提示:
把代码修改成:
UIAlertController *aleView=[UIAlertController alertControllerWithTitle:@"提示" message:@"恭喜你答对了" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *cancel=[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]; [aleView addAction:cancel]; [self presentViewController:aleView animated:YES completion:nil];
报错消失:
运行后效果如图
阅读全文
0 0
- 'UIAlertView' is deprecated的解决例子
- UIAlertView is deprecated in ios9
- UIAlertView is deprecated in iOS 8.
- UITextInputMode currentInputMode is deprecated. 警告的解决
- iOS9使用提示框的正确实现方式(UIAlertView is deprecated)
- 解决Function get_magic_quotes_gpc() is deprecated
- 解决 The type CellRangeAddress is deprecated的问题
- php 5.2以上的ereg Deprecated: Function ereg() is deprecated in 使用pregmatch 正则解决的
- 解决Deprecated: preg_replace(): The /e modifier is deprecated的三个方法
- Deprecated: Function ereg_replace() is deprecated的解决方法
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated
- 解决interfaceOrientation is deprecated:first deprecated in ios8.0
- The type SmsManager is deprecated错误解决
- 错误The type XXX is deprecated解决
- $HADOOP_HOME is deprecated的解决方法
- 如何解决刚安装完hadoop报Warning: $HADOOP_HOME is deprecated的方法
- 'dispath_get_current_queue'is deprecated:fist deprecated in iOS 6.0的解决办法
- Deprecated: mysql_connect(): The mysql extension is deprecated的解决方法
- 二.cglib实现动态代理
- java 中的io
- MySQL数据库事务实例(模拟银行转账)
- 总结
- Activity四种启动模式
- 'UIAlertView' is deprecated的解决例子
- Android 插件化
- 大数据学习之路-第01天-Centos中安装Hadoop
- Java IO: 字符流的Buffered和Filter
- zookeeper安装与配置的常见问题:Error contacting service. It is probably not running
- Unity3D中Layers和LayerMask解析
- Android studio使用Lambda表达式
- Android Java GPS坐标与高斯坐标相互转换(二)
- 电脑蓝屏检测修复方法