Comme vous pouvez le voir ci-dessous, j'utilise les coordonnées de calloutaccessorycontrol pour placer une autre vue sur ma mapview. Toutefois. il ne semble jamais placer le contrôle n'importe où près du calloutaccessorycontrol. C'est étrange, car j'utilise ses coordonnées x et y.Les coordonnées X et Y du bouton de légende droit ne placent pas mes vues avec précision
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view
calloutAccessoryControlTapped:(UIControl *)control
{
HotelInformationViewController *vc =
[[HotelInformationViewController alloc]initWithNibName:@"HotelInformationViewController"
bundle:nil control:control];
[self.view addSubview:vc.view];
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil control:(UIControl *)control
{
if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]))
{
self.view.bounds = CGRectMake(control.frame.origin.x, control.frame.origin.y, 286, 286); //As you can see here I am using the x and y to place the new control
}
return self;
}