
@H_419_12@
@H_419_12@
mapVIEw.showsUserLocation = YES;
要显示自定义注释,请在地图视图注记上设置图像属性@H_419_12@
@H_419_12@
- (MKAnnotationVIEw *)mapVIEw:(MKMapVIEw *)mapVIEw vIEwForAnnotation:(ID<MKAnnotation>)annotation {// check for nil annotation,dequeue / reuse annotation// to avoID over rIDing the user location default image ( blue dot )if ( mapVIEw.UserLocation == annotation ) {return nil; // display default image}MKAnnotationVIEw* pin = (MKAnnotationVIEw*)[mapVIEw dequeueReusableAnnotationVIEwWithIDentifIEr: PIN_RECYCLE_ID];if ( pin == nil ) {pin = [(MKAnnotationVIEw*) [[MKAnnotationVIEw alloc] initWithAnnotation:annotation reuseIDentifIEr: PIN_RECYCLE_ID] autorelease] ;pin.canShowCallout = YES;}else {[pin setAnnotation: annotation];}pin.image = [UIImage imagenamed:@"car-image.png"];return pin;} 总结 以上是内存溢出为你收集整理的objective-c – 如何在地图工具包中显示默认用户位置和自定义的年度视图?全部内容,希望文章能够帮你解决objective-c – 如何在地图工具包中显示默认用户位置和自定义的年度视图?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)