problame / CSNotificationView

Drop-in, semi-translucent and blurring notification view.
MIT License
900 stars 152 forks source link

Visual bug on modal dialog (iPad) #56

Closed tobihagemann closed 9 years ago

tobihagemann commented 9 years ago

I think the status bar height is hard coded, so it looks weird on a modal dialog (form sheet) on iPad.

ipad-bug

Any idea on how to fix that properly?

problame commented 9 years ago

Hi, at first thanks for the bug report. You can check out the code calculating the notification view's frame here

In essence, the height is a harcoded constant kCSNotificationViewHeight plus the dynamic topLayoutGuideLength calculated by topLayoutGuideLengthCalculation

I do not have time to fix the bug right now but I'd be happy if you tracked it down and created a PR. Thanks!

tobihagemann commented 9 years ago

Thanks for the info, but I just don't know how to fix this properly, because I'm not aware of the edge cases.

I've replaced

CGFloat topLayoutGuideLength = [self topLayoutGuideLengthCalculation];

with

CGFloat topLayoutGuideLength = self.parentViewController.topLayoutGuide.length;

and this seems to fix it. But then I don't know why self.parentNavigationController would be needed in some cases. And this would also ignore your comment about a workaround in the topLayoutGuideLengthCalculation method.

problame commented 9 years ago

We had a lengthy discussion about this in another PR thread: https://github.com/problame/CSNotificationView/pull/57#discussion_r28272702

CSNotificationView is always presented in a navigation controller (if possible). parentNavigationController is the navigation controller that contains the parentViewController when initializing CSNotificationView. It is also used to keep a notification view visible while the user navigates within the navigation hierarchy.