【问题标题】:Custom InfoWindows issue -Google Maps iOS SDK-自定义 InfoWindows 问题 -Google Maps iOS SDK-
【发布时间】:2014-05-03 09:30:12
【问题描述】:

我非常密切地关注 Google Maps Custom InfoWindows Video,但似乎无法让我的工作。这是我的 viewcontroller.m 的一部分:

GMSMarker *food = [[GMSMarker alloc] init];
food.position = CLLocationCoordinate2DMake(43.468725, 11.287411);
food.map = mapView_;
mapView_.mapType = kGMSTypeTerrain;
food.icon = [UIImage imageNamed:@"foodmarker"];

}
-(UIView *) mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)food
{

CustomInfoWindow *infoWindow = [[[NSBundle mainBundle] loadNibNamed:@"InfoWindow" owner:self options:nil] objectAtIndex:0];
infoWindow.name.text = @"FoodPlace";
infoWindow.address.text = @"Some kinda food location";
infoWindow.photo.image = [UIImage imageNamed: @"food"];
return infoWindow;
}

我在返回 infoWindow 时收到错误消息: 从结果类型为“UIView *”的函数返回“CustomInfoWindow *”的不兼容指针类型

我的 CustomInfoWindow 类连接到将显示为自定义信息窗口的 Nib。 问题是当我点击标记时没有任何反应或出现。

【问题讨论】:

    标签: ios xcode sdk maps


    【解决方案1】:

    对此我不确定,但我认为您可以通过识别检查器解决此问题。这是 XCode 右侧的区域,右起第三个按钮。或查看->实用程序->显示身份检查器。在身份检查器的顶部,您可以设置自定义类。现在它可能是 UIView。改为将其设置为 CustomInfoWindow。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-04
      • 2017-03-05
      • 1970-01-01
      • 2013-05-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多