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

MessageBar doesn't appear if app has no status bar. #35

Closed
hlung opened this issue Apr 5, 2014 · 5 comments
Closed

MessageBar doesn't appear if app has no status bar. #35

hlung opened this issue Apr 5, 2014 · 5 comments
Labels

Comments

@hlung
Copy link

hlung commented Apr 5, 2014

From https://github.com/terryworona/TWMessageBarManager/blob/master/Classes/TWMessageBarManager.m#L587-L590

If app has no status bar, -statusBarFrame will return CGRectZero, making -width returns 0, which makes message bar not appear at all.

- (CGFloat)width
{
    return [self statusBarFrame].size.width;
}
- (CGRect)statusBarFrame
{
    return [self orientFrame:[UIApplication sharedApplication].statusBarFrame];
}

Suggested fix...

- (CGRect)statusBarFrame
{
    if ([UIApplication sharedApplication].isStatusBarHidden) {
        return CGRectMake(0, 0, [UIApplication sharedApplication].keyWindow.frame.size.width, 0);
    }
    else {
        return [self orientFrame:[UIApplication sharedApplication].statusBarFrame];
    }
}
@terryworona
Copy link
Owner

A whole slew of issues arise when a status bar is hidden and there are orientation changes.

We rely heavily on status bar orientation notifications, etc.

Will have to rethink this one...

@terryworona terryworona added the bug label Apr 6, 2014
@terryworona
Copy link
Owner

Hey @DanielKrofchick, any idea on how we can go about fixing this? Only thing I can think of is hardcoding the status bar sizes when isStatusBarHidden == YES for -(CGRect)statusBarFrame.

@hlung
Copy link
Author

hlung commented Apr 7, 2014

Yeah, that's what I worry about too.

On 2014/04/07, at 1:20, terryworona notifications@github.com wrote:

A whole slew of issues arise when a status bar is hidden and there are orientation changes.

We rely heavily on status bar orientation notifications, etc.

Will have to rethink this one...


Reply to this email directly or view it on GitHub.

@DanielKrofchick
Copy link
Contributor

Hi @terryworona. It seems it's best then not to trigger off of the statusBar. Fortunately there's a UIDevice orientation notification. I've put together a fix. I'll send over a pull request.

@terryworona
Copy link
Owner

Fixed in PR #36 commit: 041fd5d

Tag: v1.4.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants