mrackwitz / MRProgress

Collection of iOS drop-in components to visualize progress
MIT License
2.55k stars 306 forks source link

iOS 8 orientation #65

Closed ulechka closed 9 years ago

ulechka commented 9 years ago

Hello!

I have a problem with MRProgressOverlayView in iPad Project. The view with indicator and label is overrotated - when the orientation is not Portrait.

I tried to comment out code in two function (separately). Here:

- (CGAffineTransform)transformForOrientation {
//    if ([self.superview isKindOfClass:UIWindow.class]) {
//        return CGAffineTransformMakeRotation(MRRotationForStatusBarOrientation());
//    }
    return CGAffineTransformIdentity;
}

And there:
static inline CGFloat MRRotationForStatusBarOrientation() {
//    UIInterfaceOrientation orientation = UIApplication.sharedApplication.statusBarOrientation;
//    if (orientation == UIInterfaceOrientationLandscapeLeft) {
//        return -M_PI_2;
//    } else if (orientation == UIInterfaceOrientationLandscapeRight) {
//        return M_PI_2;
//    } else if (orientation == UIInterfaceOrientationPortraitUpsideDown) {
//        return M_PI;
//    }
     return 0;
}

in both cases the white view with indicator and label become ok, but overlay view frame is portrait width, and screen have a padding on left and right.

Did I miss something?

romanr commented 9 years ago

Yes, this is totally broken on iPad + iOS8. Displayed sideways at 90 degree if device orientation is Landscape.

romanr commented 9 years ago

Instead of removing the code simply add if around those blocks:

if ([[[UIDevice currentDevice] systemVersion] compare:@"8.0" options:NSNumericSearch] != NSOrderedAscending) {
///
}
mrackwitz commented 9 years ago

This fixed on the master and in the prerelease 0.8.0-alpha1.