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

Banners Off-Screen if No Status Bar #26

Open
apiech opened this issue Dec 9, 2014 · 7 comments
Open

Banners Off-Screen if No Status Bar #26

apiech opened this issue Dec 9, 2014 · 7 comments

Comments

@apiech
Copy link

apiech commented Dec 9, 2014

my app has the status bar hidden so (on iOS8 and possibly other versions), [[UIApplication sharedApplication] statusBarFrame].size returns (0, 0). This is causing JCNotificationPresenters to put the banner half off screen.

I don't have the time right now to fully understand this entire library to know if my change is good but for my purposes this is a quick-fix:
CGSize statusBarSize = [[UIApplication sharedApplication] statusBarFrame].size;
// AP: if the status bar is hidden it has size 0, so pretend it's the width of the display window
if(statusBarSize.width < 1) {
statusBarSize = CGSizeMake(window.bounds.size.width, statusBarSize.height);
}

@jcoleman
Copy link
Owner

jcoleman commented Dec 9, 2014

Have you tested this in both portrait and landscape orientations?

Also, please open a pull request with the fix. I'd like to see it use comparison to CGSizeZero as well.

@apiech
Copy link
Author

apiech commented Dec 9, 2014

tested in portrait and landscape, seems good to me. I don't know if I like
CGSizeZero because it's really the width that is causing the offscreen
positioning. I doubt there will be status bars with zero width and non-zero
height though, so either way should be fine?

left some comments on the pull request with alternative ideas, I've only
looked at your project for 30 minutes so I don't know why things are how
they are

I pretty much created my github account to do this so let me know if I
messed it up :) pretty complicated process but a simple enough change to
get my feet wet.

thanks!

On Tue, Dec 9, 2014 at 2:36 PM, James Coleman [email protected]
wrote:

Have you tested this in both portrait and landscape orientations?

Also, please open a pull request with the fix. I'd like to see it use
comparison to CGSizeZero as well.


Reply to this email directly or view it on GitHub
#26 (comment)
.

@benjaminhallock
Copy link

CONFIRM: I have an AVCaptureSession with navigationbar && statusbar hidden.

It is halfway off the screen.

@mnill
Copy link

mnill commented Jun 17, 2015

Issue is still there :-(

@jcoleman
Copy link
Owner

@mnill Can you confirm that the suggested patch works? I'm actually about to finally transition back into iOS projects, so I'll be looking at this soon.

@mnill
Copy link

mnill commented Jun 17, 2015

@jcoleman I'm use this pull request #20
And it is works correctly. I'm use your library as dependency on my work and will make more tests in near future.

@sridharrajagopal
Copy link

I've tried out mnill's fix too, and it works! It would be great if you could pull the changes in, and update the pod.

Thanks for your work - it's really awesome! :-)

-Sridhar

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

5 participants