Baseflow / Xamarin-Sidebar

A slideout navigation control for Xamarin.iOS
https://baseflow.com
Apache License 2.0
113 stars 67 forks source link

ChangeContentView() problem causes existing views to have tap events hidden. #25

Closed roflkins closed 9 years ago

roflkins commented 9 years ago

ChangeContentView() does not correctly remove the _tapGesture recognizer from the existing view when the menu is open, causing it to no longer receive any tap events if the view is re shown when calling the ChangeContentView()

My suggested change starts after line 267 at SidebarController.cs:

public void ChangeContentView(UIViewController newContentView) {
            if (_contentAreaView != null)
{
                _contentAreaView.RemoveFromSuperview();
//Ensure the old gesture recognizers are removed from the view to prevent usability conflicts, especially if this view is re shown at a later time.
if (_tapGesture != null && IsOpen)
 _contentAreaView.RemoveGestureRecognizer (_tapGesture);

if (_panGesture != null)
 _contentAreaView.RemoveGestureRecognizer (_panGesture); 
}
......
jdehlin commented 9 years ago

Thank you for the suggestion. Sorry for the delay but I've gotten this integrated into the codebase. It should be up in the Component Store within a few days.