How to Simultaneously Satisfy Constraints with Keyboard and Uitoolbar

Unable to simultaneously satisfy constraints with keyboard and UIToolBar

This is Apple's bug, not yours. Ignore it. It's a widespread "issue" but there's nothing to be done about it; no visual harm is registered. It's just an annoying console dump.

Layout Constraint Errors with simple UIToolar for keyboard inputAccessoryView

Change

let aKeyboardToolBar = UIToolbar()

to

let aKeyboardToolBar = UIToolbar(frame:CGRect(x:0, y:0, width:100, height:100))

That way it has some size to work with as you are giving it content.

Unable to simultaneously satisfy constraints when UIToolbarContentView is present

In my case this was resolved by specifying a valid frame when instantiating the UIToolbar.

UIToolbar(frame: ..) instead of just UIToolbar()

For example:

UIToolbar(frame: CGRect(origin: CGPoint.zero, size: CGSize(width: _viewSizeWidth, height: CGFloat(44))))

where _viewSizeWidth was calculated elsewhere based on the window size.

AutoLayout - Unable to simultaneously satisfy constraints in swift5

I discovered the problem of this through a simulator.

When I checked with my actual iPhone, the screen looked like it was going down from top to bottom because I couldn't see the keyboard, but it was actually a short look and then it disappeared.

That's why there was a problem with the height of the toolbar. And the cause of the problem with the keyboard was the JS function.

t.select(); 
document.execCommand('copy');

Because of this part, the keyboard was visible and disappeared. So I solved this problem through a search.

t.readOnly = true;

I've solved my problem by adding this code.

Focusing a TextField causes LayoutConstraint errors in Super Simple SwiftUI app

I am unable to reproduce in 14.3 Apparently it has been fixed.



Related Topics



Leave a reply



Submit