STPopup icon indicating copy to clipboard operation
STPopup copied to clipboard

Source View in Background shifts downwards when calling Popup from Bottom

Open 7er0 opened this issue 5 years ago • 2 comments

Whenever I call the PopupVC, the view shifts around 30 points downwards, and when I dismiss, it shifts back up, which is quite annoying. Might there be a problem with the iPhone X implementation (because of safe areas)? Or might I have other unrelated code which is causing the problem (maybe extendedLayouts or something alike)?

I am calling the PopupVC like this:

ZUserInfoTableViewController *uvc = [ZUserInfoTableViewController new];
STPopupController *popupController = [[STPopupController alloc] initWithRootViewController:uvc];
popupController.style = STPopupStyleBottomSheet;
popupController.containerView.layer.cornerRadius = 3.0f;
[popupController presentInViewController:self];

And in ZUserInfoTableViewController:

- (instancetype)init
{
    if (self = [super init]) {
        CGRect screenRect = [[UIScreen mainScreen] bounds];
        CGFloat screenWidth = screenRect.size.width;
        self.contentSizeInPopup = CGSizeMake(screenWidth, 500);
        self.landscapeContentSizeInPopup = CGSizeMake(400, 200);
    }
    return self;
}

I am glad for any help!

7er0 avatar Mar 14 '19 13:03 7er0

Hi @7er0 , could you upload a screenshot? Is this a new issue introduced in 1.8.4?

kevin-lyn avatar Mar 16 '19 21:03 kevin-lyn

@kevin0571 I also noticed this bug. Please, look at the screenshots. When the popup opens, it shifts the view down.

But when I close the popup, it returns back. As you can see, in my app I use the blur effect, so, it's not very noticeable for users.

Also, the bug doesn't appear if the navigation bar is visible on the page. Only when it's modified as on my screenshot (e.g. transparent).

Screen Shot 2019-06-18 at 16 48 33 Screen Shot 2019-06-18 at 16 49 37

Ariandr avatar Jun 18 '19 13:06 Ariandr