简体   繁体   English

Google Maps在标记信息窗口iOS中显示语音气泡

[英]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.

相关问题 如何在不点击标记的情况下在 iOS 谷歌地图中显示信息窗口? - How to show a Info window in iOS Google maps without tapping on Marker? Google Maps SDK iOS - 带UIButton的自定义标记信息窗口 - Google Maps SDK iOS - Custom marker info window with UIButton 以编程方式谷歌地图iOS的标记的关闭信息窗口 - Close info window of a marker programmatically google maps iOS 如何在iOS谷歌地图中显示所有信息窗口而无需点击标记? - How to show all Info window in iOS Google maps without tapping on Marker? ios谷歌地图绘制多个标记问题(信息窗口和标记重复) - ios google maps plotting multiple markers issues(info window and marker repeating) 如何在ios上添加一个按钮到谷歌地图标记信息窗口? - How can i add a button to google maps marker info window on ios? 如何使用AFnetworking图像缓存在iOS Google Maps中刷新标记信息窗口? - How to refresh marker info window in iOS Google maps with AFnetworking Image cache? 在Google地图上加载标记的自定义信息窗口时,iOS应用程序冻结 - iOS app freezes when loading custom info window for marker on Google Maps IOS谷歌地图sdk中的自定义信息窗口 - Custom info window in IOS google maps sdk 在iOS中移动Google地图信息窗口 - Moving Google Maps Info Window in iOS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM