【问题标题】:How to customize the InfoWindow of google map iOS SDK?如何自定义google map iOS SDK的InfoWindow?
【发布时间】:2013-02-17 03:12:19
【问题描述】:

我想改变 google map iOS SDK 的 InfoWindow 的宽度。有什么办法吗?

我想要这样做的原因是在 InfoWindow 中显示完整的地址。除了自定义 InfoWindow,还有其他方法吗?

另外,我可以更改 InfoWindow 中的文本大小吗?

至少,我想实现这样的地图效果: http://www.google.com/about/company/facts/locations/ 也可以应用超链接。

【问题讨论】:

    标签: google-maps-markers google-maps-mobile google-maps-sdk-ios


    【解决方案1】:

    将地图delegate设置为视图控制器,然后实现google maps的委托方法

    -(UIView *)mapView:(GMSMapView *) aMapView markerInfoWindow:(GMSMarker*) marker
    {
        UIView *view = [[UIView alloc]init];
        //customize the UIView, for example, in your case, add a UILabel as the subview of the view
        return view;
    }
    

    【讨论】:

    • 哦,我明白了。通过这种方式,我们可以将任何其他视图放入 UIView 来自定义 InfoWindow。
    猜你喜欢
    • 1970-01-01
    • 2014-06-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-26
    • 1970-01-01
    相关资源
    最近更新 更多