我通过Googla地图iOS版SDKGMSMapView中隐藏导航栏
从谷歌代码示例说明申报的观点或多或少只是删除这个方法在你的代码
- (void)loadView {
// Create a GMSCameraPosition that tells the map to display the
// coordinate -33.86,151.20 at zoom level 6.
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86
longitude:151.20
zoom:6];
mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
mapView_.myLocationEnabled = YES;
self.view = mapView_;
// Creates a marker in the center of the map.
GMSMarker *marker = [[GMSMarker alloc] init];
marker.position = CLLocationCoordinate2DMake(-33.86, 151.20);
marker.title = @"Sydney";
marker.snippet = @"Australia";
marker.map = mapView_;
}
它自动地实现通过GMSMapView作品,但mapView恰好覆盖了我的导航项目 很明显,这些地图的尺寸在initWithFram:CGRectZero ,但只是将参数更改为自定义CGRect
CGRect square = CGRectMake(100, 100, 100, 100);
有没有为我工作,任何其他建议? 我只需要显示导航项目和标签栏之间的映射(但第二不会发生被覆盖)
谢谢,这有助于Swift版本。不过,我想知道,如果这是正确的方法,即依靠导航栏(44)的大小来抵消地图视图。 – Eduardo