Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When the keyboard over laps the popover #63

Closed
Isuru-Nanayakkara opened this issue Feb 2, 2014 · 3 comments
Closed

When the keyboard over laps the popover #63

Isuru-Nanayakkara opened this issue Feb 2, 2014 · 3 comments

Comments

@Isuru-Nanayakkara
Copy link

Hi,

Great library. I'm using this in my second project. In this one however, I have run in to a small situation. The popover I'm displaying is fairly long. Therefore when the keyboard comes up, it overlaps the popover.

As a solution, I added a UIScrollView to the popover and in viewDidLayoutSubviews mthod, I set its its contentSize and frame. Like so

self.scrollView.contentSize = CGSizeMake(self.view.frame.size.width, self.scrollView.frame.size.height);
self.scrollView.frame = self.view.frame;

This almost works. The scrollview works as expected but there's a small hitch. The scrollview doesn't cover the entire popover screen.
screen shot 2014-02-02 at 8 30 33 pm
Notice the first textfield disappearing from the middle of the screen.

I have a demo project here if this is all too confusing.
https://www.dropbox.com/s/gfcp5q364z4k968/PopoverTest.zip

Can you please take a look at it and tell me how to correct this? I'd really appreciate it.

Thank you.

@viking2009
Copy link

try self.scrollView.frame = self.view.bounds;

@Isuru-Nanayakkara
Copy link
Author

Works like a charm 👍 Thank you :D

@nicolaschengdev
Copy link
Owner

Thanks!
👍 for viking2009

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

No branches or pull requests

3 participants