![](/img/trans.png)
[英]how can i place swrevealview as a third view controller,if we make swrevealview as a initial view controller its working
[英]How to disable the interaction of front view but if we tap on fron view then rear view should close in swrevealview controller
我使用的是swreveal视图控制器,我想在单击菜单后单击,然后如果我们单击前视图然后后部应该关闭,则我们将无法与前视图交互。 我正在使用下面的代码来禁用交互,但是如果我们禁用交互,那么点击guesture也将不起作用。
- (void)revealController:(SWRevealViewController *)revealController willMoveToPosition: (FrontViewPosition)position {
if(position == FrontViewPositionLeft) {
self.view.userInteractionEnabled = YES;
} else {
self.view.userInteractionEnabled = NO;
}
}
- (void)revealController:(SWRevealViewController *)revealController didMoveToPosition: (FrontViewPosition)position {
if(position == FrontViewPositionLeft) {
self.view.userInteractionEnabled = YES;
} else {
self.view.userInteractionEnabled = YES;
hideFilter=[[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
hideFilter.backgroundColor=[UIColor blueColor];
[self.view addSubview:hideFilter];
SWRevealViewController *reveal = self.revealViewController;
reveal.delegate = self;
if ( reveal )
{
[hideFilter addGestureRecognizer:self.revealViewController.tapGestureRecognizer];
[hideFilter addGestureRecognizer:self.revealViewController.panGestureRecognizer];
}
}
}
我使用了hidefilter隐藏self.view的交互并在其上添加一个手势,但是单击它之后,该视图应删除并交互主视图。 那我该怎么做 如果还有另一种方法,请告诉谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.