gpt4 book ai didi

在谷歌地图上加载标记的自定义信息窗口时,iOS 应用程序卡住

转载 作者:IT王子 更新时间:2023-10-29 05:51:55 25 4
gpt4 key购买 nike

我正在尝试在 iOS 应用程序的 Google map 标记上实现自定义信息窗口。 (例如 herehere 完成。)

我已经为它创建了一个 xib 和一个 UIView 类。它被称为 CustomInfoWindow.xib,类是 CustomInfoWindow.swift

我的自定义信息窗口目前是空白的,即我还没有向我的 xib 添加任何 UIControl。我还没有在我的类文件中添加任何代码。

CustomInfoWindow.swift 文件基本上是这样的:

import UIKit
class CustomInfoWindow: UIView {}

在我的 map 的 ViewController 中,我的 markerInfoWindow 方法如下:

func mapView(mapView: GMSMapView!, markerInfoWindow marker: GMSMarker!) -> UIView! {
let customInfoWindow = NSBundle.mainBundle().loadNibNamed("CustomInfoWindow", owner: self, options: nil)[0] as! CustomInfoWindow

return customInfoWindow
}

当我运行代码并单击其中一个标记时,空白的 CustomInfoWindow 显示正常。

奇怪的是,当我将任何 UI 元素添加到 Interface Builder 中的 CustomInfoWindow.xib 并再次运行我的应用程序时,当我单击标记时应用程序突然卡住。 (例如,当我将 UILabelUIImage 添加到 CustomInfoWindow.xib 时。)如果我删除 UI 元素,则会显示空白 Nib 在标记上很好。

如果我通过将它作为 subview 添加到某些 View Controller 上来测试我的 Nib ,那么它可以很好地加载我的 UILabelUIImage。但是,当我在 markerInfoWindow 中使用相同的 Nib 时,应用程序会卡住。

可能是什么问题?

更新:此问题发生在适用于 iOS 的 Google Maps SDK 版本 1.13 上,结果是 bug on that version .

最佳答案

我也有同样的问题。这是 GoogleMaps 的错误!卡住版本 1.13.0 中的应用程序。

您可以使用:

pod 'GoogleMaps', '1.12.3'

关于在谷歌地图上加载标记的自定义信息窗口时,iOS 应用程序卡住,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36746786/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com