Skip to content

Commit d08bafe

Browse files
committed
fix bug on iOS8
1 parent 0194386 commit d08bafe

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

SIAlertView/SIAlertView.m

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ - (id)initWithFrame:(CGRect)frame andStyle:(SIAlertViewBackgroundStyle)style
8888
self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
8989
self.opaque = NO;
9090
self.windowLevel = UIWindowLevelSIAlertBackground;
91+
92+
UIViewController *viewController = [[SISecondaryWindowRootViewController alloc] init];
93+
self.rootViewController = viewController;
94+
viewController.view.hidden = YES;
95+
viewController.view.frame = self.bounds;
96+
viewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
9197
}
9298
return self;
9399
}
@@ -278,14 +284,7 @@ + (void)setAnimating:(BOOL)animating
278284
+ (void)showBackground
279285
{
280286
if (!__si_alert_background_window) {
281-
CGRect frame = [[UIScreen mainScreen] bounds];
282-
if([[UIScreen mainScreen] respondsToSelector:@selector(fixedCoordinateSpace)])
283-
{
284-
frame = [[[UIScreen mainScreen] fixedCoordinateSpace] convertRect:frame fromCoordinateSpace:[[UIScreen mainScreen] coordinateSpace]];
285-
}
286-
287-
__si_alert_background_window = [[SIAlertBackgroundWindow alloc] initWithFrame:frame
288-
287+
__si_alert_background_window = [[SIAlertBackgroundWindow alloc] initWithFrame:[UIScreen mainScreen].bounds
289288
andStyle:[SIAlertView currentAlertView].backgroundStyle];
290289
[__si_alert_background_window makeKeyAndVisible];
291290
__si_alert_background_window.alpha = 0;

0 commit comments

Comments
 (0)