mkannotationview

MKAnnotationView - Lock custom annotation view to pin on location updates

大城市里の小女人 提交于 2019-11-26 08:56:19
问题 Update #5 I guess it\'s bounty time. 100+ views and no one\'s taken a stab, even with the code sample I\'ve posted. How about some reputation points! Update #4 This is a pretty complicated question, so I created a new tab based project which just includes the parts of my app I\'m having trouble with here. You can download it from: http://www.servinitup.net/CustomCalloutAnnotation.zip Feel free to open it up (need to add your own bundle identifier to run it on your phone) and play around with

Customize the MKAnnotationView callout

余生长醉 提交于 2019-11-26 08:44:43
问题 I want to create a custom MKAnnotationView callout as shown in this image. I have tested several solutions but they only allow customization of the left/right images and title/subtitle. Can anybody please give me some source code or tutorial link for it? Currently I am clueless. Please help. 回答1: I understand you want a pin with a custom callout. We can't create a custom callout, but we can create an annotation with a completely customized view. So the trick is to add a second annotation when

How to create Custom MKAnnotationView and custom annotation title and subtitle

会有一股神秘感。 提交于 2019-11-26 07:34:09
问题 I need to create above Annotation view on MKMapView. I am able to create the custom annotation view but on the tap of annotation the view need to be opened image with that big text, I am not able to create that one. Please provide me some links or the way to do this task. 回答1: To create a custom annotation view (your replacement for the standard pin), you can just set the image property of the MKAnnotationView in the viewForAnnotation method: - (MKAnnotationView *)mapView:(MKMapView *)mapView

How to recognize which pin was tapped

醉酒当歌 提交于 2019-11-26 04:51:55
问题 I got an app with MKMapView and large number of pins on this map. Every pin got rightCalloutAccessoryView . I create it in this way: UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; [rightButton addTarget:self action:@selector(showDetails:) forControlEvents:UIControlEventTouchUpInside]; pinView.rightCalloutAccessoryView = rightButton; How should i know, which pin was tapped? Thnx 回答1: In the showDetails: method, you can get the pin tapped from the map view's

How to customize the callout bubble for MKAnnotationView?

泪湿孤枕 提交于 2019-11-26 03:47:01
问题 I\'m currently working with the mapkit and am stuck. I have a custom annotation view I am using, and I want to use the image property to display the point on the map with my own icon. I have this working fine. But what I would also like to do is to override the default callout view (the bubble that shows up with the title/subtitle when the annotation icon is touched). I want to be able to control the callout itself: the mapkit only provides access to the left and right ancillary callout views

Swift different images for Annotation

五迷三道 提交于 2019-11-26 03:10:24
问题 I managed to get a custom icon for a annotation pin in Swift, but now I am still stuck using 2 different images for different annotations. Right now a button adds a annotation to the map. There should be another button that also adds a annotation but with another icon. Is there a way to use the reuseId for this? class ViewController: UIViewController, MKMapViewDelegate { @IBOutlet weak var Map: MKMapView! @IBAction func btpressed(sender: AnyObject) { var lat:CLLocationDegrees = 40.748708 var