[英]Google Maps Showing speechbubble in marker info window iOS
I am using GoogleMaps SDK in my iOS application. 我在iOS应用程序中使用GoogleMaps SDK。 I have implemented custom info window for GoogleMaps and calling it my ViewController as,
我已经为GoogleMaps实现了自定义信息窗口,并将其称为“我的ViewController”,
func mapView(mapView: GMSMapView!, markerInfoContents marker: GMSMarker!) -> UIView! {
var calloutView:CalloutView = NSBundle.mainBundle().loadNibNamed("CalloutView", owner: self, options: nil)[0] as! CalloutView
views!.detailDisclosure.addTarget(self, action: "detailDisclosureButton_Clicked:", forControlEvents: UIControlEvents.TouchUpInside)
views.labelText.text = "ABC Text"
return views
}
And getting output as below 并获得如下输出
Info window overlapping and showing bottom edges as below. 信息窗口重叠并显示底部边缘,如下所示。 Also button on info window not getting clicked.
信息窗口上的按钮也没有被单击。 Please help for the same.
请同样提供帮助。
With my experience, - mapView:markerInfoContents:
have some problems. 以我的经验,
- mapView:markerInfoContents:
有一些问题。 In my case, I ended up using - mapView:markerInfoWindow:
instead. 就我而言,我最终使用
- mapView:markerInfoWindow:
代替。 In this case, you have to draw balloon image by yourself, like this: 在这种情况下,您必须自己绘制气球图像,如下所示:
Also button on info window not getting clicked.
信息窗口上的按钮也没有被单击。
As documented on the bottom of this , markerInfoWindow is rendered as an image, but not true UIView
. 如本文底部所述 ,markerInfoWindow呈现为图像,但不是真实的
UIView
。
Note: The info window is rendered as an image each time it is displayed on the map.
注意:信息窗口每次显示在地图上时,都会将其渲染为图像。 This means that any changes to its properties while it is active will not be immediately visible.
这意味着在激活状态下对其属性所做的任何更改都不会立即可见。 The contents of the info window will be refreshed the next time that it is displayed.
信息窗口的内容将在下次显示时刷新。
It does not receive any UI events. 它不接收任何UI事件。 So, sad to say, any
UIControl
s on markerInfoWindow is useless. 于是,伤心地说,任何
UIControl
S于markerInfoWindow是没用的。 The only supported way is to use - mapView:didTapInfoWindowOfMarker:
delegate method, that means, you can not define multiple clickable areas on the info window. 唯一受支持的方法是使用
- mapView:didTapInfoWindowOfMarker:
委托方法,这意味着您不能在信息窗口上定义多个可单击区域。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.