2016-04-29 40 views
0

我想從xib文件加載UIView成爲我的GMSMarker信息窗口。我想那樣做:GMSMarker infoWindow不顯示並凍結應用程序

-(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; 
} 

任何人都知道爲什麼會發生?我無法理解它一個多星期!

我會真正appriciate如果有人可以幫助我在這裏,非常感謝你!

回答