ピン画像を使用する代わりに、MKPinAnnotationViewピンのようにプログラムでピンを描画したい。誰かがアイデアを持っているなら私を助けてください。
ありがとう
ピン画像を使用する代わりに、MKPinAnnotationViewピンのようにプログラムでピンを描画したい。誰かがアイデアを持っているなら私を助けてください。
ありがとう
これを試してください
-(MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation: (id )annotation
if(annotation != mapView.userLocation)
{
static NSString *defaultPinID = @"PinId1";
pinView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:defaultPinID];
if ( pinView == nil ) pinView = [[[MKPinAnnotationView alloc]
initWithAnnotation:annotation reuseIdentifier:@"pin1"] autorelease];
//pinView= [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"pin1"];
//pinView.pinColor = MKPinAnnotationColorRed;
pinView.canShowCallout = YES;
pinView.animatesDrop = YES;
[pinView setImage:[UIImage imageNamed:@"user.png"]];
}