Is it possible to change the blue dot which indicates the user's location in MKMapView
to an image? For example a little car or any .png
image?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
Here is Swift 2.0 version in which you might have multiple pins.
In this code CustomAnnotation is just an MKAnnotation subclass. Basically if the annotation is not the kind of one of your custom classes, then its the user location pin.
is this to change the current location blue dot???
In the viewForAnnotation: method of MKMapViewDelegate probably you would be having the code like this.
We return nil if the annotation is userLocation to let the mapView display the blue dot & circle animation. In order to show our custom annotation for userLocation just remove the line
return nil;
and do your customization there.Ok, here is the Swift version:
Please try this something like this. its working for me in Xcode 7 and swift 2.