fix interface orientation for attribution view controller
Showing
1 changed file
with
12 additions
and
0 deletions
@@ -12,6 +12,9 @@ | @@ -12,6 +12,9 @@ | ||
12 | #import "RMTileSource.h" | 12 | #import "RMTileSource.h" |
13 | 13 | ||
14 | @implementation RMAttributionViewController | 14 | @implementation RMAttributionViewController |
15 | +{ | ||
16 | + RMMapView *_mapView; | ||
17 | +} | ||
15 | 18 | ||
16 | - (id)initWithMapView:(RMMapView *)mapView | 19 | - (id)initWithMapView:(RMMapView *)mapView |
17 | { | 20 | { |
@@ -24,6 +27,8 @@ | @@ -24,6 +27,8 @@ | ||
24 | 27 | ||
25 | if (self) | 28 | if (self) |
26 | { | 29 | { |
30 | + _mapView = mapView; | ||
31 | + | ||
27 | self.view.backgroundColor = [UIColor darkGrayColor]; | 32 | self.view.backgroundColor = [UIColor darkGrayColor]; |
28 | 33 | ||
29 | [self.view addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissModalViewControllerAnimated:)]]; | 34 | [self.view addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissModalViewControllerAnimated:)]]; |
@@ -32,6 +37,8 @@ | @@ -32,6 +37,8 @@ | ||
32 | 37 | ||
33 | webView.delegate = self; | 38 | webView.delegate = self; |
34 | 39 | ||
40 | + webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin; | ||
41 | + | ||
35 | webView.backgroundColor = [UIColor clearColor]; | 42 | webView.backgroundColor = [UIColor clearColor]; |
36 | webView.opaque = NO; | 43 | webView.opaque = NO; |
37 | 44 | ||
@@ -56,6 +63,11 @@ | @@ -56,6 +63,11 @@ | ||
56 | return self; | 63 | return self; |
57 | } | 64 | } |
58 | 65 | ||
66 | +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation | ||
67 | +{ | ||
68 | + return [_mapView.viewControllerPresentingAttribution shouldAutorotateToInterfaceOrientation:interfaceOrientation]; | ||
69 | +} | ||
70 | + | ||
59 | #pragma mark - | 71 | #pragma mark - |
60 | 72 | ||
61 | - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType | 73 | - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType |
-
Please register or login to post a comment