Closed jojojames closed 10 years ago
You can just subscribe to the event and return false whenever you dont want swiping to work. Here is how I use it:
ShouldReceiveTouch = (sender, touch) => { bool isMovingCell = touch.View.ToString().IndexOf("UITableViewCellReorderControl", StringComparison.InvariantCultureIgnoreCase) > -1; if (isMovingCell || touch.View is UISlider || touch.View is MPVolumeView || isMovingCell || touch.View is ProgressView || touch.View is OBSlider) return false; return true; }
That makes it so it wont work on things like a UISlider.
How would I use this from another controller?
(appDelegate.rootViewController as MainController).FlyoutNavigation.ShouldReceiveTouch = (sender, touch) => { return true; };
Thanks again.
I would have a boolean on whatever class holds you menu. Optionally you could fork and just add a disable flag right on the menu itself.
So there's a way to set whether not you can set the touch on a class that holds the FlyoutNavigation? I'm still getting a similar error, 'The event `FlyoutNavigation.FlyoutNavigationController.ShouldReceiveTouch' can only appear on the left side of + or -= when used outside of the type.'
From this error message, I'm thinking only your second recommendation would work unless I'm missing something.
So yes its an event so you need FlyoutNavigation.ShouldReceiveTouch += (sender, touch) => { return true; };
Not sure how to disable the flyout navigation based on the API available.
There is a navigation.ShouldReceiveTouch but I'm not sure how to use it to disable the flyout from being used.
Thanks.