-
Notifications
You must be signed in to change notification settings - Fork 39
Adding an OLGhostAlertView while displaying a keyboard will cause it to be placed under the keyboard #3
Comments
Well, this could be amended by using some keyboard listener that always receives these notifications from the beginning of the app's life cycle. Being a singleton (dispatch_once) you could query it for the status and keyboard height. There are some examples of this, and I can give you one if needed. |
This sounds great, it'd be awesome if you could give me some examples. Doing this would also fix #2. |
Something like in my gist here: https://gist.github.com/3845949 You'd call it once in And in any other class you might want to know about the current state of the keyboard, just inlcude LWSKeyboardListener.h and get the properties of the shared instance (keyboardShowed, keyboardRect, keyboardHeight). For example in OLGhostAlertview.m in the I added keyboardHeight, because the keyboardRect doesn't care for the interface orientation and always has coordinates as if the device were upright, home button on the bottom. Therefore I simply return the minimum of width and height of the rect. |
This looks like a nice solution, but I wanna keep OLGAV as simple as possible. I'll mention your comment on the README for people who need this fixed. Thanks a lot! |
Yes, I understand completely. It's quite unfortunate that there is no public API for this. |
This can also be worked around using the |
Hi,
|
Since we can only receive notifications for keyboards if they are fired after we init an OLGhostAlertView, we can't know if there's one being displayed before instantiating the view, and therefore we cannot adjust the frame accordingly, causing the view to be placed under the keyboard in the view hierarchy.
There's really no way that we know of to fix this. Adding the view as a subview of the key window (#1) does allow for the view to be drawn on top of the keyboard, but this is not acceptable behaviour.
The text was updated successfully, but these errors were encountered: