San San - 2 months ago 7
Objective-C Question

How to stop scrolling in mkmapview?

I'm using a

MKMapView
in my application and use
mapView.scrollEnabled=NO;
but it's not working. Here is my code:

mapView=[[MKMapView alloc] initWithFrame:CGRectMake(20, 100, 282, 209)];
mapView.delegate=self;
mapView.scrollEnabled=NO;
[self.view addSubview:mapView];


Is there something wrong with my code?

Answer

You have used YES instead of NO in your code. Please use NO as below.

mapView.scrollEnabled = NO;
Comments