title: MKMapView not filling view (iOS)
body: <p>I am creating a view programmatically. The view is fairly simple as it only contains an <code>MKMapView</code> which I want to fill the screen (with the exception of the navigation bar at the top).</p>
  
  <p>Here is what I am doing to setup the MKMapView:</p>
  
  <pre><code>- (void)setupMapView
  {
      mapView = [[MKMapView alloc] initWithFrame:self.view.frame];
      mapView.delegate = self;
      mapView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
  
      [self.view addSubview:mapView];
  }
  </code></pre>
  
  <p>However, the <code>MKMapView</code> doesn't seem to fill the entire screen. If you look at the top of this screenshot there is a gap between the top of the map and the bottom of the navigation bar (which is added by the <code>UINavigationController</code>).</p>
  
  <p><img src="https://i.stack.imgur.com/4FlkA.jpg" alt="enter image description here"></p>
  
  <p>Please could someone suggest why this is happening and how I can fix it?</p>