Reputation: 247
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=YES;
[self.view addSubview:mapView];
Is there something wrong with my code?
Upvotes: 2
Views: 4670
Reputation: 39978
You have used YES
instead of NO
in your code. Please use NO
as below.
mapView.scrollEnabled = NO;
Swift
mapView.isScrollEnabled = false
Upvotes: 15
Reputation: 4712
Try to set
mapView.scrollEnabled=NO;
or set
mapView.userInteractionEnabled = NO;
but it does not allow you to zoom in or out and other things. click here for more info.
Upvotes: 3
Reputation: 7921
Try to set userInteractionEnabled
property of MKMapView
to NO
.
mapView.userInteractionEnabled = NO;
Upvotes: 2