我正在使用一个带有自定义placeMark的标签,它有一个NSString值,我想把它作为标签添加到mkannotationview图像中。
- (MKAnnotationView *)mapView:(MKMapView *)MapView viewForAnnotation:(MyPlaceMark *)annotation{
static NSString* AnnotationIdentifier = @"AnnotationIdentifier";
MKAnnotationView* MyView = [[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:AnnotationIdentifier] autorelease];
MyView.canShowCallout=YES;
MyView.image = [UIImage imageNamed:@"MyImage.png"];
return MyView;}
这将是最好的方式来获得它,我试图添加一个标签的图像,但我有问题的CGRect,我得到了什么,任何想法如何制作它
谢谢!
发布于 2011-05-30 11:30:56
注释视图绘制图像?在这种情况下,我会添加一个UILabel作为子视图。
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(x,y,width,height)];
[yourView addSubview:label];
[label release];
https://stackoverflow.com/questions/6175670
复制相似问题