Skip to content

iOS Keyboard Breaks ConstraintΒ #281

@Topazoo

Description

@Topazoo

Webview is causing UI issues when the keyboard is opened on iOS. The error is consistent across iOS versions 10-12 and across multiple devices. This occurs when the webview is housed in a Rect.

Error message:

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:0x600001297160 h=-&- v=-&- _UIToolbarContentView:0x7fcfbbc0d500.width == UIToolbar:0x7fcfbbc0ce90.width (active)>",
"<NSLayoutConstraint:0x600001280550 H:|-(0)-[_UIButtonBarStackView:0x7fcfbbd45fa0] (active, names: '|':_UIToolbarContentView:0x7fcfbbc0d500 )>",
"<NSLayoutConstraint:0x6000012805a0 _UIButtonBarStackView:0x7fcfbbd45fa0.trailing == _UIToolbarContentView:0x7fcfbbc0d500.trailing (active)>",
"<NSLayoutConstraint:0x60000129e3f0 H:|-(8)-[_UIModernBarButton:0x7fcfbbd68f00'Done'] (active, names: '|':_UIButtonBarButton:0x7fcfbbd68370 )>",
"<NSLayoutConstraint:0x60000129db80 H:[_UIModernBarButton:0x7fcfbbd68f00'Done']-(20)-| (active, names: '|':_UIButtonBarButton:0x7fcfbbd68370 )>",
"<NSLayoutConstraint:0x6000012f2120 'UISV-canvas-connection' UILayoutGuide:0x6000008d4a80'UIViewLayoutMarginsGuide'.leading == _UIButtonBarButton:0x7fcfbbd64ff0.leading (active)>",
"<NSLayoutConstraint:0x6000012f2170 'UISV-canvas-connection' UILayoutGuide:0x6000008d4a80'UIViewLayoutMarginsGuide'.trailing == _UIButtonBarButton:0x7fcfbbd68370.trailing (active)>",
"<NSLayoutConstraint:0x6000012f21c0 'UISV-spacing' H:[_UIButtonBarButton:0x7fcfbbd64ff0]-(0)-[UIView:0x7fcfbbd67600] (active)>",
"<NSLayoutConstraint:0x6000012f2210 'UISV-spacing' H:[UIView:0x7fcfbbd67600]-(0)-[_UIButtonBarButton:0x7fcfbbd677e0] (active)>",
"<NSLayoutConstraint:0x6000012f2260 'UISV-spacing' H:[_UIButtonBarButton:0x7fcfbbd677e0]-(0)-[UIView:0x7fcfbbd68190] (active)>",
"<NSLayoutConstraint:0x6000012f22b0 'UISV-spacing' H:[UIView:0x7fcfbbd68190]-(0)-[_UIButtonBarButton:0x7fcfbbd68370] (active)>",
"<NSLayoutConstraint:0x600001297110 'UIView-Encapsulated-Layout-Width' UIToolbar:0x7fcfbbc0ce90.width == 0 (active)>",
"<NSLayoutConstraint:0x6000012802d0 'UIView-leftMargin-guide-constraint' H:|-(0)-UILayoutGuide:0x6000008d4a80'UIViewLayoutMarginsGuide' (active, names: '|':_UIButtonBarStackView:0x7fcfbbd45fa0 )>",
"<NSLayoutConstraint:0x600001280370 'UIView-rightMargin-guide-constraint' H:[UILayoutGuide:0x6000008d4a80'UIViewLayoutMarginsGuide']-(0)-|(LTR) (active, names: '|':_UIButtonBarStackView:0x7fcfbbd45fa0 )>")
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x60000129db80 H:[_UIModernBarButton:0x7fcfbbd68f00'Done']-(20)-| (active, names: '|':_UIButtonBarButton:0x7fcfbbd68370 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions