How to show blue pin with dot (circle) in MKMapView in IPhone

后端 未结 4 2243
礼貌的吻别
礼貌的吻别 2020-12-31 21:04

my question may seem a bit complicated but let me clarify. i am using mkmapview , in this i want to show current user location with blue dot and circle , but this isn\'t rea

4条回答
  •  天命终不由人
    2020-12-31 21:57

    Add this to the top of the viewForAnnotation method:

    if ([annotation isKindOfClass:[MKUserLocation class]])
    return nil;
    

    The special user location annotation is of type MKUserLocation and returning nil in that case tells the map view to draw the default view for it which is the blue dot. and go in MKMapview property and check the show user location....

提交回复
热议问题