Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
312 views
in Technique[技术] by (71.8m points)

ios - Detect Callout overlap other UIViews in MKMapView

I have Some UIViews that are displayed over an MKMapView to serve as controls to filter the content of the map and my mapView have annotations that can show callout.I want to create an effect where my overlays will fade away if my callout appears or gets scrolled under the overlays and become visible again after the callout does not takes its place.

Is there a way to find out if the Callout of an MKMapView is overlapping a UIView?

I have tried:

  1. Accessing frame of Callout to check if it intersects the overlays - couldn't access callout.
  2. Calculating where the callout will appear and keeping track of the scrolling to calculate if the callout goes under the overlay - Unable to predict behaviour of callout appearing - how it shifts to avoid popping up outside the screen
  3. Making overlay controls take a separate screen space as map - map becomes too small, certain screen area becomes unoccupied as controls do not take up a rectangular space. Will use this as last resort if no solution to my problem.

Edit

I made a gif of the effect I wanted

enter image description here

The Blue square will represent the controls and the red represent the callout, basically I want to make my overlay controls of my map fade away when the callout goes under it.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...