自定义百度地图的paopaoView 点击大头针paopaoView有时候出不来
刚开始以为是精度圈影响的, 各种隐藏精度圈
你妈蛋,今天无意中发现是我自定义的paopaoview 是xib里画的影响到了, 果断改纯代码就好了
AnnotationView
// 根据anntation生成对应的View自定义大头针
- (BMKAnnotationView *)mapView:(BMKMapView *)mapView viewForAnnotation:(id <BMKAnnotation>)annotation
{
if(![annotationisKindOfClass:[StoreAnnotationclass]]) {
returnnil;
}
StoreAnnotation *storeAnnotation = (StoreAnnotation *)annotation;
NSString *annotationViewId =@"StoreAnnotation";
BMKAnnotationView *annotationView = (BMKAnnotationView *)[_mapViewdequeueReusableAnnotationViewWithIdentifier:annotationViewId];
if(annotationView ==nil){
annotationView = [[BMKAnnotationViewalloc] initWithAnnotation:annotationreuseIdentifier:annotationViewId];
}
annotationView.image =kImageNamed(@"bike ");
//设置弹出气泡图片自定义paopaoview
AnnotationView*subView = [[AnnotationViewalloc]initWithFrame:CGRectMake(0,0,198,68)];
subView.storeM = storeAnnotation.model ;
BMKActionPaopaoView *pView = [[BMKActionPaopaoViewalloc]initWithCustomView:subView];
pView.frame =CGRectMake(0,0, 198,78);
annotationView.paopaoView = pView;
return annotationView;
能发现问题就离解决问题不远了, 刚开始解决方向一直不对, 设了背景后,才看出是系统的BMKActionPaopaoView出来的,我自定义的没加上去