[英]How to change annotation callout button color in iphone?
我想將上述藍色標注按鈕更改為灰色。 這個怎么做?? 這也可能使整個注釋氣泡可點擊嗎??? 誰能建議我這種方法。
您可能正在添加藍色按鈕,如下所示
- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{
MKPinAnnotationView *annView=(MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"annViewIdentifier"];
if (annView == nil) {
annView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"annViewIdentifier"] autorelease];
}
UIButton *infoDefaultButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
[infoDefaultButton addTarget:self
action:@selector(showDetails:)
forControlEvents:UIControlEventTouchUpInside];
annView.rightCalloutAccessoryView = infoDefaultButton;
}
如果需要任何自定義按鈕,則可以添加UIButtonTypeCustom
而不是UIButtonTypeDetailDisclosure
並設置其框架。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.