I'm adding a UIToolbar
in top of the keyboard using inputAccesoryView
:
let toolbar = UIToolbar()
toolbar.barStyle = .default
toolbar.isTranslucent = true
toolbar.sizeToFit()
toolbar.isUserInteractionEnabled = true
...
textField.inputAccessoryView = toolbar
But when I hide the keyobard, rotate the device, the next time I open the keyboard, sometimes it shows the UIToolbar
in the middle of the screen:
But the next time I open the keyboard, the UIToolbar
it shows in the right place.
I don't know if it is an iPadOS bug. Any ideas how can I solve this? I'm using an UITableViewController
to populate table with cells and text fields.