Swift UIAlertController.addTextFieldWithConfigurationHandler显示警告“;UICollectionViewFlowLayout的行为未定义";
当我尝试使用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. 你需要打电话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
alert.view.setNeedsLayout()
就在之前
self.presentViewController(alert, animated: true, completion: nil)
您是否在应用程序的其他位置使用UICollectionView?此错误似乎不适用于粘贴的代码。相反,您的UICollectionView单元格大小似乎大于屏幕大小。@Patrick Tescher不,我没有使用UICollectionView,只是一个简单的应用程序,在uiviewcontroller上有一个按钮
self.presentViewController(alert, animated: true, completion: nil)