Search code examples
iphoneobjective-cuikitmkmapviewuitabbar

MKMapView inside Tab Bar and Navigtion Controller hides Google branding


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.


Solution

  • This fixes the issue

    mapView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);