Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift UIAlertController.addTextFieldWithConfigurationHandler显示警告“;UICollectionViewFlowLayout的行为未定义";_Swift_Uialertcontroller - Fatal编程技术网

Swift UIAlertController.addTextFieldWithConfigurationHandler显示警告“;UICollectionViewFlowLayout的行为未定义";

Swift UIAlertController.addTextFieldWithConfigurationHandler显示警告“;UICollectionViewFlowLayout的行为未定义";,swift,uialertcontroller,Swift,Uialertcontroller,当我尝试使用addTextFieldWithConfigurationHandler向alertController显示textfeild时,我收到了警告: 2015-12-14 11:03:32.022 TestAlertWithTextField[8455:1172878] the behavior of the UICollectionViewFlowLayout is not defined because: 2015-12-14 11:03:32.022 TestAlertWithTe

当我尝试使用addTextFieldWithConfigurationHandler向alertController显示textfeild时,我收到了警告:

2015-12-14 11:03:32.022 TestAlertWithTextField[8455:1172878] the behavior of the UICollectionViewFlowLayout is not defined because: 2015-12-14 11:03:32.022 TestAlertWithTextField[8455:1172878] 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. 2015-12-14 11:03:32.023 TestAlertWithTextField[8455:1172878] The relevant UICollectionViewFlowLayout instance is , and it is attached to ; layer = ; contentOffset: {0, 0}; contentSize: {0, 0}> collection view layout: . 2015-12-14 11:03:32.023 TestAlertWithTextField[8455:1172878] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger. 你需要打电话

alert.view.setNeedsLayout()
就在之前

self.presentViewController(alert, animated: true, completion: nil)

您是否在应用程序的其他位置使用UICollectionView?此错误似乎不适用于粘贴的代码。相反,您的UICollectionView单元格大小似乎大于屏幕大小。@Patrick Tescher不,我没有使用UICollectionView,只是一个简单的应用程序,在uiviewcontroller上有一个按钮
self.presentViewController(alert, animated: true, completion: nil)