大佬教程收集整理的这篇文章主要介绍了ios – 用于用户定位的自定义注释视图,不会移动mapview,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
didUpdateToLocation
delegate method(不是地图视图的didupdateUserLOCATIOn委托方法)中,创建或更新您的自定义注释:
-(void)LOCATIOnManager:(CLLOCATIOnManager *)manager didupdateToLOCATIOn:(CLLOCATIOn *)newLOCATIOn fromLOCATIOn:(CLLOCATIOn *)oldLOCATIOn { if (myUserLocAnnot == nil) { self.myUserLocAnnot = [[[MyUserLocClass alloc] init] autorelease]; //remove the autorelease if using ARC myUserLocAnnot.title = @"You are here"; myUserLocAnnot.coordinate = newLOCATIOn.coordinate; [mapView addAnnotation:myUserLocAnnot]; } else { myUserLocAnnot.coordinate = newLOCATIOn.coordinate; } }@H_262_2@最后,在地图视图的ViewForAnnotation委托方法中,如果注释是您的自定义用户位置注释,则将返回自定义注释视图.
以上是大佬教程为你收集整理的ios – 用于用户定位的自定义注释视图,不会移动mapview全部内容,希望文章能够帮你解决ios – 用于用户定位的自定义注释视图,不会移动mapview所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。