我想在点击地图标注中的披露按钮时加载另一个视图。MapView标注上的细节披露按钮将不会响应水龙头
我使用添加按钮标注在我AnnotationView实现文件的initWithAnnotation方法如下(我只显示相关的代码):
- (id)initWithAnnotation:(id<MKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier
{
self.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
}
我还增加了以下controllTapped方法对我的MapViewController执行文件,用于检测揭示按钮被窃听的时间:
-(void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
{
DetailViewController *dvc = [[DetailViewController alloc] init];
[self.navigationController pushViewController:dvc animated:YES];
}
我还为UI创建了一个带有.XIB的新的detailedDisclosure类。这是我想在用户点击披露按钮时加载的视图。
那么,当用户点击披露按钮时,为什么没有发生?
你是说我要用这个替换当前的公开按钮语法吗?在(id)initWithAnnotation ....方法中?此外,goToLocation括号中会包含什么内容? pushViewController语法? – Cybernetic 2013-04-10 13:53:33