martinjuhasz / MJPopupViewController

A UIViewController Category to display a ViewController as a popup with different transition effects.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Popup view is not centered

hemangshah opened this issue · comments

Hi there, first of all thanks a lot for this beautiful easy handy code. Your code is working fine for me, however I just found an issue with that, "I know what I'm doing and checked in your code as well, there's no issue with code", but issue is due to my requirement.

Here's my view description in which I'm showing up popup with your controller.

<UIView: 0x8dd1190; frame = (0 0; 320 559); autoresize = H; layer = <CALayer: 0x8df0200>>

Please note, it's not an iPhone5, its iPhone4 view, which will resize based on content I'll have available.

Whole view is inside UIScrollView, and I've to scroll to go down. When I tap on a button, I'm showing popup but not in centered due to size of the view.

You make it general so that it'll be helpful to large no of people.

Can you give me a hint or a patch, where I can make a change in your category class that work for me in this case.

In category class,

  • (void)presentPopupView:(UIView*)popupView animationType:(MJPopupViewAnimation)animationType dismissed:(void(^)(void))dismissed {}

I made a small change in first line,

UIView *sourceView = [self topView];
sourceView.frame = CGRectMake(0, 0, 320, 416);

so it worked in one case, but then again it'll not centered when I scroll down and load the popup, I also thinking that its wrong and improper way.

Waiting for your reply.