又是后要强制用户选择响应一个事件,那么就要用一个层覆盖整个用户界面。以下是伪码!
-(void)handleSingleTap:(UIGestureRecognizer *)gestureRecognizer{
[guideView setHidden:YES];
}
显示一个view 全屏
-(void)show
{
UIWindow *keyv=[[UIApplication sharedApplication] keyWindow];
UIView *viewss=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
[viewss setBackgroundColor:[UIColor redColor]];
viewss.alpha=0.4;
[keyv addSubview:viewss];
guideView =[[UIView alloc]initWithFrame:self.navigationController.view.bounds];
[guideView setBackgroundColor:[UIColor redColor]];
[guideView setUserInteractionEnabled:YES];
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];
[guideView addGestureRecognizer:singleTap];
[self.navigationController.view addSubview:guideView];
return;
}