Closed JeffersonSchuler closed 4 years ago
same!
For anyone that is still experiencing the freeze (but not the warnings anymore), use this: Disable 'Automatically Sync Pasteboard'. Simulator -> Edit -> Automatically Sync Pasteboard
I have the same problem in real devices
I have the same problem in all simulator.
I think it's a problem caused by system keyboard, because I have the same problem without this pod
I thought this problem because of toolbar because when I disabled it , this problems was gone :)
I can confirm that the problem is related to the toolbar.
I had more information on this. I created a clean project with two textField one is having its inputView as a UIDatePicker and another one is a simple textField with autocorrection = default. This project does not contain our library.
I found out that this constraint violation issue occurs when we switch between those 2 textFields. I believe that this is not a bug in our library but apple's implementation of the keyboard. I'm also attaching the demo project I created. TextField Constraint violation Demo.zip
how to fix ,samebody done ?
It's a bug in Apple implementation @MeiYuLong.
Anyone found a work around?
Not yet I suppose.
I'm also having the same issue :(
FIX: disable the Correction for that TextField
@hackiftekhar do you know id this bug in Apple bug report?
I have the same problem in all simulator. +1
Same issue. any workarounds? +1
@gokulprathin8 It isn't a problem of IQKeyboardManager, it is Apple internal bug.
I'm not using this framework, but I am experiencing this bug. Does anyone have a solution? For me it's happening because I have an .inputView and an .inputAccessoryView on a UITextField.
@hackiftekhar do you know id this bug in Apple bug report?
Nope.
I'm not using this framework, but I am experiencing this bug. Does anyone have a solution? For me it's happening because I have an .inputView and an .inputAccessoryView on a UITextField.
Please read previous comments for workarounds.
I am not using IQKeyboardManager but I came across the exact same problem while work with two UITextFields
where one uses the system keyboard and one has its own, custom inputView
(a UIDatePicker
). When switching from the DatePicker TextField to the normal one the constraint error is shown. In rare cases it happens that the DatePicker inputView is not shown anymore when switching back.
I digged a little deeper and found out, that the custom inputView
is places within a UIInputSetHostView
which also contains (beside others) a TUISystemInputAssistantView
. When the custom inputView
is shown everything is fine and there are no conflict. However, when switching to the TextField with the standard keyboard, the height of the TUISystemInputAssistantView
is set to 45 which conflicts with the top constraint which is set to the custom inputView
...
Long story short: A hacky workaround for this problem is to manipulate the the constraints which are set inputView
and give them a slightly lower priority :
func updateConstraintsWhenCustomKeyboardIsShown(customInputView: UIView) {
if let superview = customInputView.superview {
for constraint in superview.constraints {
if (constraint.secondItem === customInputView && constraint.secondAttribute == .top) {
constraint.priority = UILayoutPriority(999)
}
}
}
}
FIX: disable the Correction for that TextField
This fixed my problem, tks!!
Swift 5
txtField.autocorrectionType = .no
Any solutions for this? I already have autocorrectionType = false
but when autofill password is enabled. But the view still jitters when I switch between 2 input fields.
Any solutions for this? I already have
autocorrectionType = false
but when autofill password is enabled. But the view still jitters when I switch between 2 input fields.
Did you try setting to .no instead of false?
Yes I meant .no
still nothing... I believe if the Auto-Fill password keeps appearing then the problem will still be present.
Disabling autocorrection didn't work quite well for me, my issue is autofill actually. I'm experiencing this constraint issue in my OTP screen, when my device receives the OTP SMS autofill is being shown and it causes this bug to occur.
In MY case i fix this error by setting textfield correction to default
This does remove the auto correction, but it doesn't remove the password/email suggestion that also takes up space above the keyboard and causes the layout issue and up/down jumping of the form.
The problem with my code was this...
I found that I had set the toolbar this way:
let toolBar = UIToolbar(frame: CGRect(x: 0, y: 0, width: textView.frame.size.width, height: 44.0))
and the error was popping every time.
Now I have it set like this
let toolBar = UIToolbar(frame: CGRect(origin: .zero, size: CGSize(width: 100, height: 44.0)))
and the error is resolved.
Hope this helps.
I am also not currently using IQKeyboardMananger but encountered this issue and based on the info here and playing around with options in Xcode, I found that assigning a Content Type in Text Input Traits (other than the default 'Unspecified') resolved the issue for me.
eg
FIX: disable the Correction for that TextField
Jun 2020, ur solution still works! Thanks a lot ππ»
All these solutions work for auto suggestions etc, however the issue is still present on password/email suggestions that cannot be disabled unfortunately, so the "jumping" of the form still exists.
Following solution doesn't work for me.
The problem with my code was this...
I found that I had set the toolbar this way:
let toolBar = UIToolbar(frame: CGRect(x: 0, y: 0, width: textView.frame.size.width, height: 44.0))
and the error was popping every time.Now I have it set like this
let toolBar = UIToolbar(frame: CGRect(origin: .zero, size: CGSize(width: 100, height: 44.0)))
and the error is resolved.Hope this helps.
I used UITextView
and found this, the auto-correction and spell checking don't work for me, either.
textView = UITextView()
textView.autocapitalizationType = .none
textView.autocorrectionType = .no
textView.spellCheckingType = .no
textView.smartQuotesType = .no
textView.smartDashesType = .no
textView.smartInsertDeleteType = .no
it't not working with. me
θΉζθΏδΉεεΎε
Same issue.
context:
Xcode :Version 13.2.1
Simulator: iPad Pro (12.9-inch)
I have used 3 UITextField in my app for sign up page, email, password and username. I had same issue as described in the issue above at the beginning, have tried
autocorrectionType = .no
in the field, not working.
Then I moved the password field to the bottom of other two fields , then it is working,
But for Simulator iPhone13 still same warning.
not sure why
Disable the suggestions above the keyboard: spellCheckingType = .no
And if you are using a UIDatePicker for the accessoryView just use a non-default keyboard type . e.g. keyboardType = .phonePad
In case I want to show suggestions for some field, like - textField.textContentType = .telephoneNumber, then I have to disable IQKeyboardManager toolbar for that VC or ignore constraints warning, no other solution?
Setting textField.textContentType = .oneTimeCode
removed the Auto Layout warnings for me
Describe the bug Getting a layout constraint error now that I have upgraded to Xcode 11 and iOS 13 on a real device. Selecting a UITextfield that has "secure text entry" enabled causes the following error:
[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. ( "<NSLayoutConstraint:0x281b94b90 'accessoryView.bottom' _UIRemoteKeyboardPlaceholderView:0x104ffa200.bottom == _UIKBCompatInputView:0x108707890.top (active)>", "<NSLayoutConstraint:0x281b7f840 'assistantHeight' TUISystemInputAssistantView:0x108531590.height == 45 (active)>", "<NSLayoutConstraint:0x281b919a0 'assistantView.bottom' TUISystemInputAssistantView:0x108531590.bottom == _UIKBCompatInputView:0x108707890.top (active)>", "<NSLayoutConstraint:0x281b91680 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x104ffa200]-(0)-[TUISystemInputAssistantView:0x108531590] (active)>" )
Will attempt to recover by breaking constraint <NSLayoutConstraint:0x281b91680 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x104ffa200]-(0)-[TUISystemInputAssistantView:0x108531590] (active)>
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.
Expected behavior No constraint issues.
Versions
Xcode: Version 11.0 (11A420a) Mac OS: 10.15 Beta (19A573a) Simulator/Device: iOS 13.1 Simulator/Device Name: iPhone X Library Version: 6.5.0