0

I am working on an app which uses ECSlidingViewController to implement a drawer menu.

I need to keep the menu always open on the home screen but keep it hidden and only open it on swipe when I am on the other views.

Does the lib allow that kind of behaviour ?

Any advice is welcome.

Thank you in advance

Moumou
  • 1,513
  • 2
  • 18
  • 41

1 Answers1

1

I've found the solution (which was quite easy actually)

Opening the sliding menu at startup

self.slidingViewController().anchorTopViewToRightAnimated(true);

Disabling gestures on the menu

self.slidingViewController().panGesture.enabled = false;

(you should set this to true again when you change view and need the menu to respond to gestures)

There is just one problem, I can't make anchorTopViewToRightAnimated work after I change topView.

Any ideas why ?

EDIT:

I'm calling anchorTopViewToRightAnimated in viewDidAppear -> not working (after viewChange)

If I try to call that method on button click it works fine, so it must be that ECSlidingView isn't ready or smthg like that but as there are no notifications or whatsoever I can't know when to call the method.

I could subclass ECSlidingViewController but would rather avoid it if possible

Moumou
  • 1,513
  • 2
  • 18
  • 41
  • Hi, your top view's right side is hidden all the time when the menu is open? When the menu opens, the right view moves to the right (if the menu is on the left). Or are you doing something to change the top view's width? – amcastror Sep 30 '15 at 14:19
  • Hi, thanks a lot you help me a lot, btw do you know how can I enable that when touching again the menu icon the menu closes. Because right now It opens when you touch the icon but if you touch again it stays there. Thanks – VAAA May 09 '16 at 23:20
  • @VAAA Hi, you just need to check (when pressing the menu button) if the menu is open, and if it's the case close it (otherwise you just open it) – Moumou May 10 '16 at 07:04
  • @amcastror Sorry mate I just saw your comment -_- I don't remember exactly but I think it moved to the right – Moumou May 10 '16 at 07:07
  • Sorry but can you let me know whats the name of the method and where can I found it? Appreciate it. – VAAA May 10 '16 at 15:59