iOS Plus屏幕 AlerController报错
来源:互联网 发布:92game仿影视大全源码 编辑:程序博客网 时间:2024/06/06 04:38
使用UIAlertController 在6P/6sP屏幕时报错
2016-06-02 10:03:27.023 app[1581:584039] the behavior of the UICollectionViewFlowLayout is not defined because:2016-06-02 10:03:27.023 app[1581:584039] the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.2016-06-02 10:03:27.025 app[1581:584039] The relevant UICollectionViewFlowLayout instance is <_UIAlertControllerCollectionViewFlowLayout: 0x1603a9e80>, and it is attached to <UICollectionView: 0x15f30ce00; frame = (0 120.667; 270 44); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x1603aa940>; layer = <CALayer: 0x1603aa3b0>; contentOffset: {0, 0}; contentSize: {0, 0}> collection view layout: <_UIAlertControllerCollectionViewFlowLayout: 0x1603a9e80>.2016-06-02 10:03:27.025 app[1581:584039] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.
UIAlertController代码如下:
UIAlertController * alert = [UIAlertController alertControllerWithTitle:@"账号验证" message:@"请输入138****1145的中间四位" preferredStyle:UIAlertControllerStyleAlert]; [alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) { textField.placeholder = @"请输入138****1145的中间四位"; textField.textAlignment = NSTextAlignmentCenter; }]; UIAlertAction * sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { }]; UIAlertAction * cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { }]; [alert addAction:cancelAction]; [alert addAction:sureAction]; [self presentViewController:alert animated:YES completion:nil];
解决的方法:在[self presentViewController:alert animated:YES completion:nil];之前增加一句代码:
[alert.view setNeedsLayout]; [self presentViewController:alert animated:YES completion:nil];
解决问题的帮助网页链接:点击打开链接
0 0
- iOS Plus屏幕 AlerController报错
- iOS iPhone 5s/6/6Plus 屏幕尺寸
- IOS Iphone 6 以及Iphone6 Plus 屏幕的适配
- App如何适应 iPhone 5s/6/6 Plus 三种屏幕的尺寸?(iOS的屏幕适配问题)
- 原iOS APP 完美适应 iPhone 6 和iPhone6 plus 屏幕尺寸解决方案
- iOS关于iPhone6和iPhone6 Plus的屏幕适配问题
- iOS关于iPhone6和iPhone6 Plus的屏幕适配问题
- iOS 的 APP 如何适应 iPhone 5s/6/6Plus 三种屏幕的尺寸?
- iOS 的 APP 如何适应 iPhone 5s/6/6Plus 三种屏幕的尺寸?
- iOS 的 APP 如何适应 iPhone 5s/6/6Plus 三种屏幕的尺寸?
- iOS 的 APP 如何适应 iPhone 5s/6/6Plus 三种屏幕的尺寸
- iOS 如何适应 iPhone 5s/6/6 Plus 三种屏幕的尺寸?
- iOS 的 APP 如何适应 iPhone 5s/6/6Plus 三种屏幕的尺寸?
- iOS 的 APP 如何适应 iPhone 5s/6/6Plus 三种屏幕的尺寸?
- iOS 的 APP 如何适应 iPhone 5s/6/6Plus 三种屏幕的尺寸?
- iOS 的 APP 如何适应 iPhone 5s/6/6Plus 三种屏幕的尺寸?
- iOS 的 APP 如何适应 iPhone 5s/6/6Plus 三种屏幕的尺寸?
- iOS 的 APP 如何适应 iPhone 5s/6/6Plus 三种屏幕的尺寸?
- /bin,/sbin,/usr/sbin,/usr/bin 目录
- SQL中的cast()和convert()函数
- 简化原生效果_集成UITableViewCell左滑多个按钮
- [leetcode] 【链表】 138. Copy List with Random Pointer
- JAVA帮助文档全系列 JDK1.5 JDK1.6 JDK1.7 官方中英完整版下载
- iOS Plus屏幕 AlerController报错
- RT-Thread的I/O设备模块及其驱动实现步骤
- Linux系统用户账号的管理
- 打造Android集合控件数据绑定(支持添加监听,支持AbsListView与RecycleView,支持异步加载等)(三)具体实现
- Eclipse快捷键-方便查找
- 求0至大数之间的随机数
- 禁用VS2010的IntelliSense
- 架构——秒杀系统架构分析与实战
- c++内存泄漏检测