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

iOS 8 landscape orientation issue #59

Closed
ivanharmat opened this issue Sep 12, 2014 · 12 comments
Closed

iOS 8 landscape orientation issue #59

ivanharmat opened this issue Sep 12, 2014 · 12 comments

Comments

@ivanharmat
Copy link

How could this be fixed?
Messages work fine with portrait orientation, but they are either cut off (iPhone) or all over the screen (iPad). iOS 7 works like a charm, both orientations.
Thank you.

@terryworona
Copy link
Owner

Haven't looked into it. No time at the moment. Give it a try!

@ivanharmat
Copy link
Author

Alright, I'll see what I can do.
Thanks for the quick reply.

@ivanharmat
Copy link
Author

I did not spend much time trying to fix it, but this little hack fixes the iOS 8 issue for me:

- (CGRect)orientFrame:(CGRect)frame
{
    NSString *systemVersion = [UIDevice currentDevice].systemVersion;
    NSUInteger systemInt = [systemVersion intValue];

    if ( (UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation) || UIDeviceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) && systemInt < 8 )
    {
        frame = CGRectMake(frame.origin.x, frame.origin.y, frame.size.height, frame.size.width);
    }
    return frame;
}

I just simply added an iOS version number to the if conditional above.

@PhillipApps
Copy link

Having the same issue in landscape, the bar is taking the whole view unfortunately.

@ivanharmat
Copy link
Author

have you tried to replace the orientFrame method with the one above? That fixed the problem for me.

@PhillipApps
Copy link

Yes I tried, but problem is that when I turn my device, tap on the button which shows the message, it's shown as portrait

EDIT:
Tried again it works! Thanks man. Don't know why it was bugging me yesterday.

@terryworona
Copy link
Owner

@ivanharmat do you want to submit a pull request with your patch?

@ivanharmat
Copy link
Author

sure. thanks. I'll get to it right now.

@ivanharmat
Copy link
Author

@terryworona I can't push my branch to git. It says "Permission to terryworona/TWMessageBarManager.git denied to ivanharmat."
Can you updated the code and create a new commit?

@terryworona
Copy link
Owner

You'll have to issue a pull request @ivanharmat

See: https://help.github.com/articles/using-pull-requests

I can cherry pick your code but then you won't get any credit :)

@terryworona terryworona reopened this Sep 23, 2014
@ivanharmat
Copy link
Author

OK @terryworona,
let me try again. I need to learn this anyway :)

@MittalBanker
Copy link

@PhillipApps Please replace orientFrame method with this

  • (CGRect)orientFrame:(CGRect)frame
    {
    NSString *systemVersion = [UIDevice currentDevice].systemVersion;
    NSUInteger systemInt = [systemVersion intValue];

    if ( (UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation) || [UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeLeft || [UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeRight) && systemInt < 8 )
    {
    frame = CGRectMake(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height);
    }
    return frame;
    }

frame = CGRectMake(frame.origin.x, frame.origin.y, frame.size.height, frame.size.width); in original code which should be like this

frame = CGRectMake(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height);

thanks

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

4 participants