From e26c3f7a4b308d38a762c6af02222d9e471043bc Mon Sep 17 00:00:00 2001 From: Timur Bernikowich Date: Thu, 6 Nov 2014 18:01:39 +0300 Subject: [PATCH] [ios] Fixed bug with banners in landscape mode on iPhones. --- iphone/Maps/Classes/InterstitialView.h | 2 +- iphone/Maps/Classes/InterstitialView.mm | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/iphone/Maps/Classes/InterstitialView.h b/iphone/Maps/Classes/InterstitialView.h index 7cc2b53c4b..87995b8fc9 100644 --- a/iphone/Maps/Classes/InterstitialView.h +++ b/iphone/Maps/Classes/InterstitialView.h @@ -24,4 +24,4 @@ typedef NS_ENUM(NSUInteger, InterstitialViewResult) { - (instancetype)initWithImages:(NSArray *)images inAppMessageName:(NSString *)messageName imageType:(NSString *)imageType delegate:(id )delegate; - (void)show; -@end +@end \ No newline at end of file diff --git a/iphone/Maps/Classes/InterstitialView.mm b/iphone/Maps/Classes/InterstitialView.mm index 10a9c345e1..e0bc63d3b7 100644 --- a/iphone/Maps/Classes/InterstitialView.mm +++ b/iphone/Maps/Classes/InterstitialView.mm @@ -119,10 +119,15 @@ - (void)show { - UIView * view = [self viewWindow]; + UIWindow * window = [[UIApplication sharedApplication].windows firstObject]; + NavigationController * vc = (NavigationController *)window.rootViewController; + if (!IPAD && !UIInterfaceOrientationIsPortrait(vc.interfaceOrientation)) + return; + if (!IPAD) [self blockRotation:YES]; + UIView * view = [self viewWindow]; for (UIView * subview in view.subviews) { if ([subview isKindOfClass:[self class]])