简体   繁体   中英

How to get height of emoji keyboard in iOS 11 when switching input type immediately?

I am using the code below:

CGRect keyboardFrame = [[userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];

but it doesn't work exactly.

You can subscribe to notifications: UIKeyboardWillChangeFrame or UIKeyboardDidChangeFrame . In handlers you can get the end frame of the keyboard.
Here I've created an example application.

When switching to emoji keyboard by pressing the language selector button (the globe), it seems that a UIKeyboardWillChangeFrame -notification gets sent. But when changing by long pressing the language selector button, no notification is sent.

It looks to me as a bug in iOS 11, since even the apple messages app and facebook messenger app doesn't handle this right. I've submitted a radar about this with id: 36657137

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM