Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6610933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:54:15+00:00 2026-05-25T19:54:15+00:00

I have a MkMapView on which I have some Annotations. When I click an

  • 0

I have a MkMapView on which I have some Annotations. When I click an annotation Its detail is opened in another view which has scroll view in bottom half of map view. When we scroll through scrollview the map centers on next annotation and its details are shown in scrollview.

My problem is that I want to add a tap gesture on Map so that when i tap on map the scrollview should hide. For this purpose I added a UiTapGesture on map which also works fine but the issue is that annotations on map no longer remain tapable. The map always goes to action of tapgesture and it never call again the selectannotation method?

How can I fix this issue????

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:54:15+00:00Added an answer on May 25, 2026 at 7:54 pm

    You can tell your gesture recognizer and the map’s to work simultaneously by implementing the shouldRecognizeSimultaneouslyWithGestureRecognizer delegate method.

    When creating the tap gesture, set its delegate:

    tapGR.delegate = self;  //also add <UIGestureRecognizerDelegate> to @interface
    

    and implement the method:

    - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer 
        shouldRecognizeSimultaneouslyWithGestureRecognizer
            :(UIGestureRecognizer *)otherGestureRecognizer
    {
        return YES;
    }
    

    Now both your tap gesture method and the didSelectAnnotationView will get called.

    Assuming your tap handler gets called first, you can remove and nil the scrollview there and then the didSelectAnnotationView would create and add the scrollview. If the sequence turns out to be different, you might need to add some flags to coordinate the removal/creation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a mapview with several annotations. Every annotation has a leftCalloutAccessoryView which is
I have a FrameLayout view which contains one (MapView-like) control and some additional buttons
I have two views. The first is a MKMapView with some annotations. Clicking a
I have an MKMapView which allows the user to scroll the map around. Later,
I have an iPad app that has an MKMapView embedded in a UINavigationController which
I have a view controller with an MKMapView that calls [self.mapView setRegion:region animated:YES]; which
We have a MKmapView with a bunch of Image Annotation where each Image annotation
As well as my question Removing MKMapView Annotations causes leaks. I have discovered that
I have a ViewController (with a MKMapView) which is pushed into, because of the
I have two activities one displaying map view and another listview, the main objective

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.