views:

133

answers:

2

I just received the following message when submitting to the app store:

In addition, the application displays images provided by Google Maps without the corresponding Google branding, we cannot post this version to the App Store

I have a TabBar with a NavigationController inside. The Navigation Controller loads the map in

- (void)viewDidLoad {
    [super viewDidLoad];
    mapView = [[MKMapView alloc] initWithFrame:self.view.bounds];
    // ...
}

This works, but the mapView ends below the tab bar, so the Google logo is not shown. To get the frame correctly I have to create it manually

- (void)viewDidLoad {
    [super viewDidLoad];
    mapView = [[MKMapView alloc] initWithFrame:CGRectMake(0,0,320,370)];
    // ...
}

This works, but doesn't feel right. What is the right way to do it?

The main interface (TabBar + Navigation Controllers) is created in Interface Builder.

A: 

Thats fine. :p Similarly you could do:

- (void)viewDidLoad {
    [super viewDidLoad];
    CGRect bounds = self.view.bounds;
    bounds.size.height -= 90; // i think the tab bar controller is 90
    mapView = [[MKMapView alloc] initWithFrame:bounds];
    // ...
}
Thomas Clayson
i do appologise 49 is the nav bar. Tab bar controller is 90 (well, i've done 90 just now and it works fine with google branding). :)
Thomas Clayson
OK, but still doesn't feel right that I have to enter the dimensions to fit in standard controls already placed in Interface Builder
Jorge Bernal
+1  A: 

This fixes the issue

mapView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
Jorge Bernal