ios - iPad版TextFields切换时出现约束错误

标签 ios swift xcode keyboard constraints

UITextField 获得焦点并且我选择不同的 UITextField 时,我收到以下错误(仅限 `iPad):

[LayoutConstraints] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) ( "<NSAutoresizingMaskLayoutConstraint:0x60400028fa50 h=--& v=--& UIKeyboardAssistantBar:0x7f8895c0e5f0.height == 0 (active)>", "<NSLayoutConstraint:0x60c000289d30 V:|-(0)-[_UIButtonBarStackView:0x7f8895c11180] (active, names: '|':UIKeyboardAssistantBar:0x7f8895c0e5f0 )>", "<NSLayoutConstraint:0x60c00028b130 V:[_UIButtonBarStackView:0x7f8895c11180]-(0)-| (active, names: '|':UIKeyboardAssistantBar:0x7f8895c0e5f0 )>", "<NSLayoutConstraint:0x60400028ec90 'UIButtonBar.maximumAlignmentSize' _UIButtonBarButton:0x7f8895e2f950.height == UILayoutGuide:0x60c0001a7700'UIViewLayoutMarginsGuide'.height (active)>", "<NSLayoutConstraint:0x60c000285f50 'UIView-bottomMargin-guide-constraint' V:[UILayoutGuide:0x60c0001a7700'UIViewLayoutMarginsGuide']-(9)-| (active, names: '|':_UIButtonBarStackView:0x7f8895c11180 )>", "" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x60c000285f50 'UIView-bottomMargin-guide-constraint' V:[UILayoutGuide:0x60c0001a7700'UIViewLayoutMarginsGuide']-(9)-| (active, names: '|':_UIButtonBarStackView:0x7f8895c11180 )>

注意

我正在使用 UICollectionViewController 并且我所有的 UITextFields 都在 UICollectionViewCells 中。

我遇到的问题似乎与 this 相同.另外,我的键盘类型是十进制。

最佳答案

如果我在切换 TextFields 之前按 command + k,那么我不会收到任何约束错误。

关于ios - iPad版TextFields切换时出现约束错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51442316/

相关文章:

swift - 如何使用 Swift 在 XCode UI Automation 中选择随机 tableview 单元格

ios - 在iOS中获取iBeacon的地理位置经度和纬度

ios - 如何为图像 UIImagePicker Swift 4 添加属性

ios - Xcode Storyboard 上的并排约束

ios - 使用 Xcode 中的 UI 测试在 UIWebView 中加载的网页中键入文本时出现问题

ios - Swift XCUI 字符串断言失败

ios - 检查对象数组中键的值是否与iOS相同?

ios - alamofire,下载多张图片

ios - View Controller 加载了两次

iphone - 如何减小 iPhone View 中日期选择器控件的大小