使用UIWebView的GMSMarker的自定义信息窗口 [英] Custom info window for GMSMarker utilising UIWebView
问题描述
我正在为一个项目使用Google Map iOS SDK,并在尝试为GMSMarker对象实现自定义信息窗口时遇到问题。我遵循Google视频教程,但不是使用UILabel和UIImage,而是在UIView中放置一个UIWebView,因为这会显示HTML格式的文本。但是,当我运行代码时,UIWebView始终是空白的。如果我用A UILabel替换信息窗口。有没有其他人试图在iOS SDK中使用这样的UIWebView?我想知道是否它与UIWebView花费太长时间来呈现?
最后我检查了信息窗口必须是静态uiview,因为它呈现给图像。 (与标记相同的不是UIViews,而只是静态图像)
我这样做的方式:
返回一个对于GMSMapView和THEN来说是空的透明视图:
将自己添加为子视图!
此链接显示了我所描述的内容:
https://github.com/ryanmaxwell/GoogleMapsCalloutView
I am using the Google Map iOS SDK for a project and have run into a problem whilst trying to implement a custom info window for a GMSMarker object. I have followed the Google video tutorial but instead of using A UILabel and UIImage, I am placing a UIWebView in the UIView as this will display HTML formatted text. However, when I run the code the UIWebView is always blank. If I replace with A UILabel the info window works. Has anyone else tried to use a UIWebView like this with the iOS SDK? I am wondering if it's related to the UIWebView taking too long to render?
last I checked the info window had to be a static uiview as it is rendered to an image. (same as markers are not UIViews but only static images)
the way I do it:
return an empty transparent view to the GMSMapView and THEN:
roll your own that you add as a subview yourself!
This link show what I described:
https://github.com/ryanmaxwell/GoogleMapsCalloutView
这篇关于使用UIWebView的GMSMarker的自定义信息窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!