iOS Setting frame size for MKAnnotationView
iOS Setting frame size for MKAnnotationView
- Subject: iOS Setting frame size for MKAnnotationView
- From: Philip Vallone <email@hidden>
- Date: Thu, 27 Jan 2011 08:01:02 -0500
Hi,
I am having trouble setting the size of the "call out bubble" on my viewForAnnotation protocol. How can I set the frame size of the call out?
This line has no effect:
[callout setFrame:CGRectMake(0, 0, 240, 240)];
Here is my code:
- (MKAnnotationView *)mapView:(MKMapView *)MapView viewForAnnotation:(id <MKAnnotation>)annotation
{
MKPinAnnotationView *callout = (MKPinAnnotationView *) [self.mapView dequeueReusableAnnotationViewWithIdentifier: @"PinIdentifier"];
[callout setFrame:CGRectMake(0, 0, 240, 240)];
if (callout == nil) {
callout = [[[MKPinAnnotationView alloc] initWithAnnotation: annotation reuseIdentifier: @"PinIdentifier"] autorelease];
}else {
callout.annotation = annotation;
}
callout.pinColor = MKPinAnnotationColorGreen;
callout.animatesDrop = YES;
callout.draggable = YES;
callout.canShowCallout = YES;
callout.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
UIImage *image = [UIImage imageNamed:@"gps_add.png"];
UIImageView *imgView = [[[UIImageView alloc] initWithImage:image] autorelease];
callout.leftCalloutAccessoryView = imgView;
return callout;
}
thanks,
Phil
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden