[英]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.