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

The Popover doesn't resize after a setPreferredContentSize. #158

Open
Janne-M opened this issue Nov 26, 2014 · 3 comments
Open

The Popover doesn't resize after a setPreferredContentSize. #158

Janne-M opened this issue Nov 26, 2014 · 3 comments

Comments

@Janne-M
Copy link

Janne-M commented Nov 26, 2014

I make a call to setPreferredContentSize in my viewWillAppear when I have calculated the appropriate size, but the Popover I'm contained in does not respect my change.
This is on iOS8.

I spent some time researching it and to me it look like it's due to the KVO addObserver call on these selectors (setPreferredContentSize & contentSizeForViewInPopover) are made in a concurrent block during initialization.
I have noticed that iOS8 uses a much 'lazier' initialization scheme and that probably pushes these addObserver calls to after my viewControllers viewWillAppear.

I made a small hack and just moved the KVO setup out of the block, back to the main initialization and then it worked as I would expect.
I don't know the reason to put this type of KVO setup in a concurrent block so I'd hope You can come up with a more appropriate and correct solution.

@annamf
Copy link

annamf commented Feb 3, 2015

I have the same problem only in iPads with iOS 8. Do you solve it?

@chlebta
Copy link

chlebta commented Mar 31, 2015

I got some issue, to solve I did like this :

popoverController.popoverContentSize = CGSizeMake(width+20, height+20);

in showPop method 🎯

@Junyi1227
Copy link

I have the same problem only in iPads with iOS 8. Do you solve it?

I use autolayout.
when I get UI.frame, I don't change Pop Size
@Janne-M

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

4 participants