Skip to content

Frame measurements to address hardware keyboard#1

Open
quinlijohn wants to merge 3 commits intoAlexQuinlivan:masterfrom
quinlijohn:keyboard-measurements
Open

Frame measurements to address hardware keyboard#1
quinlijohn wants to merge 3 commits intoAlexQuinlivan:masterfrom
quinlijohn:keyboard-measurements

Conversation

@quinlijohn
Copy link

I believe there is a bit of silliness over the way iOS handles an inputAccessoryView and a hardware keyboard. I’ve had issues where if there is no inputAccessoryView on the first responder, UIKeyboardWillShowNotification is not triggered (and so Helium correctly measures assuming an empty keyboard frame).

However, when there is an inputAccessoryView AND a hardware keyboard, the frame provided by UIKeyboardWillShowNotification is for the software keyboard (which is actually hidden) + the height of the inputAccessoryView (visible, but locked to the bottom of the window), and not the height of what is actually visible on the screen. This appears to cause Helium to incorrectly offset the height of views that are keyboard aware.

Proposed changes are adapted from the discussion on H/W keyboards: http://stackoverflow.com/questions/2893267/how-can-i-detect-if-an-external-keyboard-is-present-on-an-ipad

…nces where an inputAccessoryView on the first responder has triggered a UIKeyboardWillShowNotification with a hardware keyboard attached.
…set, and is only ever read internally. Should it have public setters?
@quinlijohn
Copy link
Author

There is also a question over the shouldAnimateKeyboardHeight field on HLMViewController. Is it meant to be a TODO or is it intentionally readonly and unassigned?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant