Custom callout bubble moxapview ios6

I am facing a mysterious problem when choosing a pin in mapview iOS6 enter image description here

BTW, it works correctly in iOS 5, I'm not sure what they changed on the iOS 6 card, which creates this problem.

NOTE: when I click on the map, the leader directly iterates over the contacts and shows correctly

any tip / tip will be appreciated,

Thank you in advance

+4
source share
4 answers

The answer may vary slightly depending on how you implement your custom call bubble. This / was the solution I am using: Customize the MKAnnotationView callout , and I ran into the same problem.

Basically, every time a leader is displayed, I had to move the subview to the foreground.

In this case, my custom call bubble is a class called "BaseCalloutView" that contains the UIView as its ContentView property (as you can see in the UML diagram from the link above). When the annotation is selected, it runs the animateIn function from BaseCalloutView, to which I added:

[self.superview bringSubviewToFront:self]; 

As I mentioned, your mileage may vary depending on how you implement the custom call bubble. I can provide you with the full code if necessary, but to be honest, 90% of my code is located at the link above.

+6
source

This solution did not work for me, however it did:

Custom annotation view not working on iOS6

Sorry for not knowing how to set the answer correctly.

0
source

In iOS 5 and iOS 6, I try this, and that's fine

Contact never overrides CalloutView. I am using a custom calloutview, in the Base calloutView file I add the following:

  - (void)didMoveToSuperview { [super didMoveToSuperview]; [self.superview bringSubviewToFront:self]; } 
0
source

I use the same base base as the problem. [self.superview bringSubviewToFront: self]; doesn't work for me, no matter where I said it. [annimateIn] or [didMoveToSuperView] or [layoutIfNeeded]

Since this problem went away with my finger, moving the map a bit, I found it very easy to simulate this effect by putting the code in - (void) mapView: (MKMapView *) mapView didSelectAnnotationView: (MKAnnotationView *) view, The offset is very small, the visual movement does not seen.

  CLLocationCoordinate2D newCenterCoordinate = {self.mapView.region.center.latitude + 0.0000001, self.mapView.region.center.longitude + 0.0000001}; [self.mapView setCenterCoordinate:newCenterCoordinate animated:NO]; 
0
source

Source: https://habr.com/ru/post/1436130/


All Articles