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

  • Home
  • SEARCH
  • 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 8535291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:23:51+00:00 2026-06-11T10:23:51+00:00

I have a MKMapView added to a UIScrollView. I thought that the expected functionality

  • 0

I have a MKMapView added to a UIScrollView. I thought that the expected functionality would be that panning the map would cause the map to move, but it’s parent UIScrollView would not scroll. i.e. if you were panning the map, the scrollview would stay in it’s current position.

This is my code:

scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)];
    [scrollView setAutoresizingMask:UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth];
    [self.view addSubview:scrollView];

    double mapHeight = 200;
    if([AppDelegate isRunningOniPad])
        mapHeight = 400;

    map = [[MKMapView alloc] initWithFrame:CGRectMake(0, 200, self.width, mapHeight)];
    [map setExclusiveTouch:NO];
    [scrollView map];

I’ve tried setting exclusive touch to YES and to NO, but it doesn’t seem to have any effect.

Is there a way to get the behaviour working so that panning the map will stop the UIScrollView from moving? I’ve tried changing map to a UIScrollView instead of an MKMapView too, but that had the same behaviour – so I doubt that this is MKMapView specific.

  • 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-06-11T10:23:52+00:00Added an answer on June 11, 2026 at 10:23 am

    The expected outcome is correct, the scroll view should remain stationary when the Map View is touched, as this should receive the touch events before they are passed up the responder chain to the scroll view.

    I have quickly tested the above code in an empty project, and this is working as expected with a couple of alterations to the creating of frame & sizes, iPad size detection, and adding the map as a sub-view of the scroll view.

    UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)];
    [scrollView setAutoresizingMask:UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth];
    // Make the content size large to allow scroll view to move
    [scrollView setContentSize:CGSizeMake(1000, 2000)];
    [self.view addSubview:scrollView];
    
    double mapHeight = 200;
    if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
        mapHeight = 400;
    }
    
    MKMapView *map = [[MKMapView alloc] initWithFrame:CGRectMake(0, 200, self.view.bounds.size.width, mapHeight)];
    [map setExclusiveTouch:NO];
    [scrollView addSubview:map];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have added an mkpinannotation in an mkmapview. I would like to move the
I have a GPSTestViewController class that has a MKMapView with added MKAnnotations (stored in
I have added multiple ovals on map view by using below code but I
I have a MKMapView annotation object that has a right callout accessory detail disclosure
I have a label that overlays on an MKMapView . The only problem is,
As well as my question Removing MKMapView Annotations causes leaks. I have discovered that
I have an application that uses the mapview-overlay-manager code to draw map markers on
I have an MKMapView and am adding an overlay (MKOverlay) to it. I would
I have a MKMapView that has a pin than when pressed shows the annotation's
I have added an overlay item to my mapview but it does not show

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.