當點擊針(註釋)時,彈出式視圖顯示彈出式視圖,顯示正常,此後,當我放大或縮小地圖時,彈出式窗口未移動到根據到地圖縮放。所以我正在解決附帶圖片中的問題。 如何根據地圖上的尊重引腳移動彈出窗口(何時縮放地圖)?當地圖放大時,針上的彈出式對話框並未移動
任何建議是非常有幫助的。提前
-(void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view
{
NSString *strTitle = [NSString stringWithFormat:@"%@",[view.annotation title]];
NSMutableDictionary *dict;
NSMutableArray *temp = annotationArray;
for (int i = 0; i<[temp count]; i++)
{
dict = (NSMutableDictionary*)[temp objectAtIndex:i];
NSString *strAddress = [NSString stringWithFormat:@"%@",[dict valueForKey:@"name"]];
if([strAddress isEqualToString:strTitle]) {
[mapView deselectAnnotation:view.annotation animated:YES];
detailsViewController = [[PopOverViewController alloc] initWithNibName:@"PopOverViewController" bundle:nil];
// [viewsPassage addObject:view];
// NSOrderedSet *orderedSet = [[NSOrderedSet alloc] initWithArray:viewsPassage];
// viewsPassage = [[NSMutableArray alloc] initWithArray:[orderedSet array]];
if ([viewsPassage containsObject:view]) {
NSLog(@"present");
[self.poc dismissPopoverAnimated:YES];
}
self.poc = [[UIPopoverController alloc] initWithContentViewController:detailsViewController];
self.poc.contentViewController.view.alpha = 0;
[viewsPassage addObject:userMapView];
[self.poc setPassthroughViews:viewsPassage];
[detailsViewController.textLabel setText:strAddress];
//size as needed
self.poc.popoverContentSize = CGSizeMake(320, 400);
//show the popover next to the annotation view (pin)
CGRect popOverFrame = view.bounds;
popOverFrame.size.width = 14;
popOverFrame.size.height = 14;
[self.poc presentPopoverFromRect:popOverFrame inView:view
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
break;
}
}
}
感謝
請說明問題在解密 –
我已經更新可以檢查它 – iOSDev
您是否使用annotationView的標註? –