Skip to content

Commit 4b770f9

Browse files
committed
Fix background not full screen bug when show alert view on iOS 8 landscape
1 parent 4dcb64e commit 4b770f9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

SIAlertView/SIAlertView.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,9 @@ + (void)setAnimating:(BOOL)animating
278278
+ (void)showBackground
279279
{
280280
if (!__si_alert_background_window) {
281-
__si_alert_background_window = [[SIAlertBackgroundWindow alloc] initWithFrame:[UIScreen mainScreen].bounds
281+
CGFloat width = [UIScreen mainScreen].bounds.size.width;
282+
CGFloat height = [UIScreen mainScreen].bounds.size.height;
283+
__si_alert_background_window = [[SIAlertBackgroundWindow alloc] initWithFrame:CGRectMake(0, 0, MIN(width, height), MAX(width, height))
282284
andStyle:[SIAlertView currentAlertView].backgroundStyle];
283285
[__si_alert_background_window makeKeyAndVisible];
284286
__si_alert_background_window.alpha = 0;

0 commit comments

Comments
 (0)