【问题标题】:GMSMarker infoWindow doesn't show and freeze applicationGMSMarker infoWindow 不显示并冻结应用程序
【发布时间】:2016-04-29 10:34:20
【问题描述】:

我正在尝试从 xib 文件加载 UIView 作为我的 GMSMarker 信息窗口。我正在尝试这样做:

-(UIView *)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker
{
    //Creating "infoWindow"(infoWindow) and setting it with nib file called "infoWindow"
    CustomMarkerInfoWindow *infoWindow=[[[NSBundle mainBundle] loadNibNamed:@"CustomMarkerInfoWindow" owner:self options:nil] firstObject];

    //Setting "infoWindow"(infoWindow)'s storeNameLabel's text to "marker"(customMarker)'s title
    infoWindow.storeNameLabel.text=((customMarker*)marker).title;

    //Setting "infoWindow"(infoWindow)'s storeAddressLabel's text to marker's address
    infoWindow.storeAddressLabel.text=((customMarker*)marker).address;

    return infoWindow;
}

但是当我点击一个标记时,信息窗口不显示并且所有应用程序都冻结了(要再次开始使用它,我需要在我从多任务处理中杀死它后重新打开它)。

注意:如果我这样做,一切正常(创建一个常规的UIView):

-(UIView *)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker
{
    UIView *myView=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
    myView.backgroundColor=[UIColor blueColor];

    return myView;
}

有人知道为什么会这样吗?一个多星期都看不懂!

如果有人可以在这里帮助我,我真的很感激,非常感谢!

【问题讨论】:

    标签: ios objective-c iphone cocoa-touch google-maps-sdk-ios


    【解决方案1】:

    这是iOS app freezes when loading custom info window for marker on Google Maps的副本

    这是 Google 地图 1.13.0 版的错误。 将您的 Google Maps SDK 降级到 1.12.3,一切正常。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-12-24
    • 2019-05-06
    • 2019-03-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多