Skip to content

How do I show a message that appears above the keyboard, when the keyboard is already visible? #533

@jmarr

Description

@jmarr

If I do config.keyboardTrackingView = KeyboardTrackingView(), I can show a message and then make the keyboard visible, and the message slides up so that it remains above the keyboard (though I do see the issue mentioned in #496). However, once the keyboard is visible, if I show another message, it appears at the bottom of the view, behind the keyboard.

Next I tried creating and installing a KeyboardTrackingView into my view controller's view hierarchy and setting that as the config.keyboardTrackingView. Then if I show a message after the keyboard is up, the message appears above the keyboard. However, if I dismiss the keyboard, bring the keyboard back up, and then show another message, the message appears behind the keyboard.

Finally, I tried creating and installing a KeyboardTrackingView into my view controller's view hierarchy and then creating another UIView with its top anchored to the top of the viewController's view and its bottom anchored to the top of the KeyboardTrackingView and then using that view for the presentationContext. This generally seems to work (though it also suffered from the issue mentioned in #496). Would this be the recommended approach or should it work when using the config.keyboardTrackingView?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions