How do you disable user interaction to an entire Map (MKMapView) in iOS? I just want to disable zooming, tapping, etc and show a static map. [self.mapView setUserInteractionEnabled:NO]
didn't work. Found no working solutions via Google or other answers here on Stack (pls link if you find a working answer..). Targeting iOS 5. There should be an easier way to do this.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How can I add media attachments to my push notific
You can do this in Interface Builder like this:
How about this little hack! just place
UIView
on top of theMKMapView
having all the same frame details. Also note that thebackgroundColor
of this view should beclearColor
The key is to disable zooms and scrolls, such as:
You can set the enabled property of MKAnnotationView to NO
For disabling Zoom, you can set
mapView.zoomEnabled = FALSE;
enabled
A Boolean value indicating whether the annotation is enabled.
Discussion
The default value of this property is YES. If the value of this property is NO, the annotation view ignores touch events and cannot be selected. Subclasses may also display the annotation contents differently depending on the value of this property.