Smooth annotation movement on OS 4
To move custom annotations in my MKMapView class, I remove all annotations first and add them (which are placed in new locations) again every second. It was perfectly working on iOS 3 but 开发者_高级运维when I updated my OS and XCode to version 4.0, the annotations blink instead of having the smooth movement they used to have in previous version.
How can I keep this smooth movement?
This is probably a bad workaround and more effort than needed, but it should work:
- Get a UIImage by rendering the old MKMapView to a bitmap: Rendering UIView with its children
- Display that UIImage over your map view.
- Change your annotations (user doesn't see the blink because the image is covering the map view)
- Once the blink is done, quickly fade the image out. Not a perfect transition, but better than nothing.
精彩评论