【发布时间】:2012-05-09 10:28:13
【问题描述】:
在我的 iPhone 应用程序中,我需要在标注视图的副标题中显示指向网站的超链接。 我使用的显示地图类 url 是 Can someone point me to a leak in this code?
我需要在 subtitle.help me 中添加超链接
通过 湿婆M
【问题讨论】:
标签: iphone objective-c
在我的 iPhone 应用程序中,我需要在标注视图的副标题中显示指向网站的超链接。 我使用的显示地图类 url 是 Can someone point me to a leak in this code?
我需要在 subtitle.help me 中添加超链接
通过 湿婆M
【问题讨论】:
标签: iphone objective-c
我认为您可以通过这种方式满足您的要求..
- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{
MKPinAnnotationView *locationView;
locationView=[[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"currentloc"] autorelease];
locationView.pinColor=MKPinAnnotationColorPurple;
locationView.animatesDrop=TRUE;
locationView.canShowCallout =YES;
locationView.annotation=annotation;
locationView.calloutOffset = CGPointMake(-5, 5);
UITextView *text=[[UITextView alloc] initWithFrame:CGRectMake(0, 0, 100, 30)];
text.dataDetectorTypes=UIDataDetectorTypeLink ;
text.backgroundColor=[UIColor clearColor];
text.editable=NO;
text.text=@"http://google.com";
locationView.rightCalloutAccessoryView = text;
return locationView;
}
【讨论】: