Skip to content

Commit 6504fcd

Browse files
committed
Fixed window rotation on iOS 8 by converting the frame to the fixed coordinate space.
1 parent 2d67885 commit 6504fcd

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

SIAlertView/SIAlertView.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,14 @@ + (void)setAnimating:(BOOL)animating
299299
+ (void)showBackground
300300
{
301301
if (!__si_alert_background_window) {
302-
__si_alert_background_window = [[SIAlertBackgroundWindow alloc] initWithFrame:[UIScreen mainScreen].bounds
302+
303+
CGRect frame = [[UIScreen mainScreen] bounds];
304+
if([[UIScreen mainScreen] respondsToSelector:@selector(fixedCoordinateSpace)])
305+
{
306+
frame = [[[UIScreen mainScreen] fixedCoordinateSpace] convertRect:frame fromCoordinateSpace:[[UIScreen mainScreen] coordinateSpace]];
307+
}
308+
309+
__si_alert_background_window = [[SIAlertBackgroundWindow alloc] initWithFrame:frame
303310
andStyle:[SIAlertView currentAlertView].backgroundStyle];
304311
[__si_alert_background_window makeKeyAndVisible];
305312
__si_alert_background_window.alpha = 0;

0 commit comments

Comments
 (0)