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

Categories

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

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

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...