UIView overlay blocking underlying MapView's touch events

4121
3
Jump to solution
02-22-2012 12:37 AM
PatrickTierney
New Contributor
I'm developing an iOS app and need to display a custom, semi-transparent UIView over the entirety of my main map view. When I place this UIView over the AGSMapView, the MapView doesn't respond to touch events. I've tried replacing the touch delegate with a UIView which sits above all the windows, as well as capturing the touch events from the main window and directly sending them to the AGSMapView and touch delegates, but neither work. I can capture simple touch events and send them to the MapView, but gestures, such as pinch and zoom, can't seem to be passed.  Is there an easy way to get around this?

Thanks,
Patrick
0 Kudos
1 Solution

Accepted Solutions
Nicholas-Furness
Esri Regular Contributor
Hi Patrick,

If you deselect the "User Interaction Enabled" checkbox on your semi-transparent overlay UIView's Attribute Inspector, you should get interaction bubble through to the underlying AGSMapView.

Note, there is a "User Interaction Enabled" setting under the Identity Inspector's Accessibility section too, but you shouldn't need to modify this unless perhaps you enabled accessibility in that same section.

I've only tested this in the simulator so far, but can click, pan and pinch. Haven't tried any more complex gestures, but I suspect they'll be passed on through.

Cheers,

Nick.

P.S. I've attached a minimal XCode 4.2/iOS 5 sample project to show this in action.

View solution in original post

0 Kudos
3 Replies
Nicholas-Furness
Esri Regular Contributor
Hi Patrick,

If you deselect the "User Interaction Enabled" checkbox on your semi-transparent overlay UIView's Attribute Inspector, you should get interaction bubble through to the underlying AGSMapView.

Note, there is a "User Interaction Enabled" setting under the Identity Inspector's Accessibility section too, but you shouldn't need to modify this unless perhaps you enabled accessibility in that same section.

I've only tested this in the simulator so far, but can click, pan and pinch. Haven't tried any more complex gestures, but I suspect they'll be passed on through.

Cheers,

Nick.

P.S. I've attached a minimal XCode 4.2/iOS 5 sample project to show this in action.
0 Kudos
PatrickTierney
New Contributor
Hi Nick,

I can confirm that this solves the problem, allowing a transparent UIView to sit on top of the MapView. I had "User Interaction Enable" unchecked in the Accessibility section, but it was still checked the View section.

Thanks!
0 Kudos
Nicholas-Furness
Esri Regular Contributor
Hi Patrick,

Glad I could help. And thanks for marking it answered 🙂

Cheers,

Nick.
0 Kudos