嗨,我正在尝试在附加到 MapView MKAnnotation 标注视图的详细信息披露 UIButton 上设置背景图像。检查stackoverflow有如何设置它的一致示例,但是它似乎不适用于我的标注UIButton。我的问题是,这不起作用,仅仅是因为地图视图还是我错过了其他东西?这是我的代码:
// If an existing pin view was not available, create one.
pinView = [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"CustomPinAnnotationView"];
pinView.canShowCallout = YES;
pinView.image = [UIImage imageNamed:@"Tch4"];
//pinView.calloutOffset = CGPointMake(0, 32);
pinView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
UIImage *btnImage = [UIImage imageNamed:@"4stars"];
[pinView.rightCalloutAccessoryView setBackgroundImage:btnImage forState:UIControlStateNormal];
我在最后一行收到错误。错误是:UIView 没有可见接口声明选择器“setbackgroundimage:forstate”
感谢您对此的帮助