现在我有这样的东西:
- (MKAnnotationVIEw *)mapVIEw:(MKMapVIEw *)mapVIEw vIEwForAnnotation:(ID <MKAnnotation>)annotation{ if (annotation.coordinate == locationManager.location.coordinate) {return nil; }else { MKAnnotationVIEw *annotationVIEw = [[MKPinAnnotationVIEw alloc] initWithAnnotation:annotation reuseIDentifIEr:@"Beacon"]; // button UIbutton *button = [UIbutton buttonWithType:UIbuttonTypeDetaildisclosure]; button.frame = CGRectMake(0,23,23); annotationVIEw.rightCalloutAccessoryVIEw = button; annotationVIEw.canShowCallout = YES; return annotationVIEw;}}
但是我不能等于两个,因为我不能从坐标参数中获取坐标属性.
有谁知道任何解决方案吗?
解决方法 在这里查看文档:http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKMapViewDelegate_Protocol/MKMapViewDelegate/MKMapViewDelegate.html
正如它所说:
If the object in the annotation parameter is an instance of the
MKUserLocation
class,you can provIDe a custom vIEw to denote the
user’s location. To display the user’s location using the default
system vIEw,return nil.
所以你可以添加一个条件来检查:
if([annotation isKindOfClass: [MKUserLocation class]]) { return nil;}总结
以上是内存溢出为你收集整理的如何停止viewForAnnotation方法覆盖iOS中的默认用户位置蓝色信标全部内容,希望文章能够帮你解决如何停止viewForAnnotation方法覆盖iOS中的默认用户位置蓝色信标所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)