关闭ECSlidingViewController菜单 [英] Closing ECSlidingViewController menu

查看:81
本文介绍了关闭ECSlidingViewController菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过以下方式实现我的滑动菜单:按菜单按钮将显示我的菜单,再次按菜单将其隐藏.但是我不明白如何使用ECSlidingViewController做到这一点.将不胜感激.

I'd like to implement my sliding menu in a way that pressing the Menu button will show my menu and pressing Menu again would hide it. But I can't understand how to do it with ECSlidingViewController. Will appreciate any help.

推荐答案

ECSlidingViewController为此提供了方法:anchorTopViewToRightAnimated:anchorTopViewToLeftAnimated:resetTopViewAnimated:.

ECSlidingViewController has methods for this: anchorTopViewToRightAnimated:, anchorTopViewToLeftAnimated: and resetTopViewAnimated:.

顶视图控制器中的示例:

Example in your top view controller:

[self.slidingViewController anchorTopViewToRightAnimated:YES]

ECSlidingViewController为UIViewController提供了添加该slidingViewController属性的类别.

ECSlidingViewController provides a category for UIViewController adding this slidingViewController property.

您可能还想使用ECSlidingViewController的currentTopViewPosition来确定按钮是显示菜单还是在当前上下文中将其隐藏.

You may also want to use ECSlidingViewController's currentTopViewPosition to determine if your button should show your menu or hide it in the current context.

这篇关于关闭ECSlidingViewController菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆