【发布时间】:2013-06-25 23:01:39
【问题描述】:
我通过 Googla Maps iOS SDK 实现了 GMSMapView
来自 Google 的示例代码建议或多或少地声明视图,只需将此方法放入您的代码中
- (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_;
}
它自动工作,但 mapView 恰好覆盖了我的 navigationItem 很明显,地图在 initWithFram:CGRectZero 但只需将参数更改为自定义 CGRect
CGRect square = CGRectMake(100, 100, 100, 100);
没有为我工作,还有其他建议吗? 我只需要显示导航项和选项卡栏之间的地图(但第二个并没有被覆盖)
【问题讨论】:
标签: iphone ios google-maps cgrect google-maps-sdk-ios