1

I am integrating [ECSlidingViewController], which I found on github, in my app and I want to know if there is a property which tells me if the menu has been shown or not. I will be using this to control the functionality of the menu button, as a toggle to hide and show the menu. Is there any such property?

4

2 回答 2

6

有同样的问题,我确信有更好的方法,但我只是这样做了:

- (IBAction)revealMenu:(id)sender
{
    ECSlidingViewController *slidingViewController = self.slidingViewController;
    if (slidingViewController.currentTopViewPosition == ECSlidingViewControllerTopViewPositionAnchoredRight) {
        [slidingViewController resetTopViewAnimated:YES];
    } else {
        [slidingViewController anchorTopViewToRightAnimated:YES];
    }
}
于 2013-12-30T17:29:17.690 回答
0

我认为正确的方法是使用锚定顶视图手势来控制顶视图在锚定到侧面时的行为方式。

创建用于显示和隐藏菜单的切换的常见解决方案是:

self.slidingViewController.topViewAnchoredGesture = ECSlidingViewControllerAnchoredGesturePanning | ECSlidingViewControllerAnchoredGestureTapping;

允许用户使用 Tap 或 Pan 手势隐藏菜单。

于 2014-07-14T16:57:37.777 回答