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

Popup is Always Same Size!!!! #169

Open
Gauntletwielder opened this issue Aug 12, 2015 · 1 comment
Open

Popup is Always Same Size!!!! #169

Gauntletwielder opened this issue Aug 12, 2015 · 1 comment

Comments

@Gauntletwielder
Copy link

I am trying this seemingly nice alternative to Apple's standard popup technique.

I like the extent to which the popup can be customized.

But not matter what ViewController I pass it, it ALWAYS puts the popup at the same location with the same size. Here is the NSLog output from WYPopoverController: WYPopoverController positionPopover: : popoverContainerView.frame = {{216, 30}, {336, 509}}

I tried 4 different sized ViewControllers. The popup was the same size every time. Not useful at all. :(

I cannot use this otherwise nice alternate popup controller if it cannot respect the size of the view in the ViewController.

I could go in and modify the WYPopoverController.m file, but I don't like modifying something that should not be modified.

I would even be happy to pay for this...if it worked properly.

@Gauntletwielder
Copy link
Author

I FIXED this problem.

There is a problem in the logic of the of the contentSize method in WYPopoverController.m

I fixed the problem without modifying that implementation file.

The fix was to put both these methods in my ViewController.m file:

  • (CGSize)contentSizeForViewInPopover { // iOS 6
    return self.view.frame.size;
    }
  • (CGSize)preferredContentSize { // iOS 7 and later
    return self.view.frame.size;
    }

That will fix the problem in iOS 6, 7 and 8.

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

1 participant