diff --git a/Classes/PXAlertView.m b/Classes/PXAlertView.m index 08a7d17..f05f4ff 100644 --- a/Classes/PXAlertView.m +++ b/Classes/PXAlertView.m @@ -264,14 +264,23 @@ - (void)keyboardWillHide:(NSNotification*)notification - (CGRect)frameForOrientation { - UIWindow *window = [[UIApplication sharedApplication].windows count] > 0 ? [[UIApplication sharedApplication].windows objectAtIndex:0] : nil; - if (!window) - window = [UIApplication sharedApplication].keyWindow; - if([[window subviews] count] > 0) - { - return [[[window subviews] objectAtIndex:0] bounds]; - } - return [[self windowWithLevel:UIWindowLevelNormal] bounds]; + +#ifdef __IPHONE_8_0 + return [UIScreen mainScreen].bounds; +#else + + UIWindow *window = [[UIApplication sharedApplication].windows count] > 0 ? [[UIApplication sharedApplication].windows objectAtIndex:0] : nil; + if (!window) + window = [UIApplication sharedApplication].keyWindow; + if([[window subviews] count] > 0) + { + return [[[window subviews] objectAtIndex:0] bounds]; + } + return [[self windowWithLevel:UIWindowLevelNormal] bounds]; + +#endif + + } - (CGRect)adjustLabelFrameHeight:(UILabel *)label