• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
iOS Setting frame size for MKAnnotationView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: CoreData: Crash in NSManagedObjectContext#existingObjectWithID:error:
  • Next by Date: Re: Crash in NSPersistentDocument writeToURL:ofType:forSaveOperation:originalContentsURL:error:
  • Previous by thread: Video Frame Processing on AVFoundation
  • Next by thread: Re: iOS Setting frame size for MKAnnotationView
  • Index(es):
    • Date
    • Thread