- (MKAnnotationView *)mapView:(MKMapView *)aMapView viewForAnnotation:(id <MKAnnotation>)annotation
{
if(![annotation isKindOfClass:[MyAnnotation class]]) // Don't mess user location
return nil; MKAnnotationView *annotationView = [aMapView dequeueReusableAnnotationViewWithIdentifier:@"spot"];
if(!annotationView)
{
annotationView = [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"spot"];
annotationView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[(UIButton *)annotationView.rightCalloutAccessoryView addTarget:self action:@selector(openSpot:) forControlEvents:UIControlEventTouchUpInside];
annotationView.enabled = YES;
annotationView.canShowCallout = YES;
annotationView.centerOffset = CGPointMake(7,-15);
annotationView.calloutOffset = CGPointMake(-8,0);
} // Setup annotation view
annotationView.image = [UIImage imageNamed:@"pinYellow.png"]; // Or whatever return annotationView;
}
解决方案 »
- 关于cocos2d-x纹理裁剪的1个问题
- 关于ios上的来电显示软件的开发
- ios个人开发者证书如何用?
- iOS开发:如何实现javascrip继承
- tree工具实现的源代码
- iOS开发,大致可以分多少类?
- 小弟新人,求大神们帮忙,内存未泄露,但是tableviewcell 数据源刷新内存持续上涨
- ios的tableview的headview能添加滚动视图吗?
- 在使用GCDAsyncSocket开发过程中怎么写一个接口实现服务端对某一个端口的绑定之后的解除绑定
- 有大神么会AES/ECB/PKCS7Padding 加密么
- In App Purchase 的问题
- iphone把sqlite中的数据显示到页面中?
取坐标区域,放大这个区域,放在一个View上显示在最上层。OK了