I have a frustrating issue I have no idea how to solve
When working on a custom keyboard I discovered that on a particular screen - Apple Mail app Reply - custom keyboard gets an increase in height on every keyboard switch.
I narrowed it down to actually zero code
class KeyboardViewController: UIInputViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .yellow
}
}
Almost everywhere it looks 'normally', that is, takes up the same size as the standard keyboard - e.g. the Messages app

But the Reply screen in the Apple Mail (and maybe few other places) after a few keyboard switches looks like this

What could be causing it?
FWIW the UIKit code that I tried a while ago has only a minimal issue of flashing, then instantly resizing to normal. My current production code is SwiftUI, and it's going to be a pain to rewrite everything back and even then it can return at any point because the zero code version also has this.
EDIT
Also tried the manual constraint path. It made no difference.
class KeyboardViewController: UIInputViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .yellow
let constr = NSLayoutConstraint.init(item: self.view!, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 0, constant: 66)
constr.priority = .defaultHigh
view.addConstraint(constr)
}
}
What helped for me (as a workaround) was wrapping my SwiftUI with KeyboardKit. No idea still what to do with UiKit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With