在我的应用程序中使用 SWRevealViewController 创建滑动菜单 当我点击uiviewcontroller滑动菜单时,如果视图控制器在其他点击事件中包含tableview,则不会自动关闭 我怎么能解决这个问题 我的代码是:
SWRevealViewController *revealController = [self revealViewController];
[self.view addGestureRecognizer:revealController.panGestureRecognizer];
答案 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];