我在点击菜单后使用我想要的swreveal视图控制器然后如果我们点击前视图然后后面应该关闭我们应该无法与前视图交互。我使用以下代码禁用交互,但如果我们禁用交互,则点击guest虚拟机也将无效。
- (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中的交互并在其上添加一个gusture但是在点击它之后这个视图应该删除并交互主视图。那我该怎么做呢如果还有其他方法可以这样做,请告诉我 谢谢
答案 0 :(得分:0)
听起来你说你希望顶视图允许点击(或手势)通过它到下面的视图。
如果是这样,这里有一些Stack Overflow答案可以帮助您: