无法关闭iOS中的滑动菜单

时间:2015-08-31 06:34:17

标签: ios slidingmenu swrevealviewcontroller

enter image description here

在我的应用程序中使用 SWRevealViewController 创建滑动菜单 当我点击uiviewcontroller滑动菜单时,如果视图控制器在其他点击事件中包含tableview,则不会自动关闭 我怎么能解决这个问题 我的代码是:

 SWRevealViewController *revealController = [self revealViewController];
    [self.view addGestureRecognizer:revealController.panGestureRecognizer];

2 个答案:

答案 0 :(得分:0)

我用它来解决它: -

SWRevealViewController *revealController = [self revealViewController];
[revealController panGestureRecognizer];
[revealController tapGestureRecognizer];
[self.menueBtn addTarget:revealController action:@selector(revealToggle:) forControlEvents:UIControlEventTouchUpInside];

selector(revealToggle :)调用SWRevealViewController类

答案 1 :(得分:0)

将此代码写在绿色视图viewdidload方法上,以导航到另一个视图。

revealController=[[SWRevealViewController alloc]init];
revealController = [self revealViewController];
[self.view addGestureRecognizer:revealController.panGestureRecognizer];
revealController.delegate=self;
[revealController panGestureRecognizer];

[revealController tapGestureRecognizer];