GMSMarker 信息窗口不显示并冻结应用程序
GMSMarker infoWindow doesn't show and freeze application
我正在尝试从 xib 文件加载 UIView
作为我的 GMSMarker
信息 window。我正在尝试这样做:
-(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;
}
但是当我点击一个标记时,信息 window 不显示并且所有应用程序都冻结(要再次开始使用它,我需要在我从多任务处理中杀死它后重新打开它) .
注意:如果我这样做,一切正常(创建常规 UIView
):
-(UIView *)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker
{
UIView *myView=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
myView.backgroundColor=[UIColor blueColor];
return myView;
}
有人知道为什么会这样吗?一个多星期都看不懂!
如果有人能在这里帮助我,我将非常感激,非常感谢!
这是
的副本
这是一个 Google 地图版本 1.13.0 的错误。
将您的 Google Maps SDK 降级到 1.12.3,一切正常。
我正在尝试从 xib 文件加载 UIView
作为我的 GMSMarker
信息 window。我正在尝试这样做:
-(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;
}
但是当我点击一个标记时,信息 window 不显示并且所有应用程序都冻结(要再次开始使用它,我需要在我从多任务处理中杀死它后重新打开它) .
注意:如果我这样做,一切正常(创建常规 UIView
):
-(UIView *)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker
{
UIView *myView=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
myView.backgroundColor=[UIColor blueColor];
return myView;
}
有人知道为什么会这样吗?一个多星期都看不懂!
如果有人能在这里帮助我,我将非常感激,非常感谢!
这是
这是一个 Google 地图版本 1.13.0 的错误。 将您的 Google Maps SDK 降级到 1.12.3,一切正常。