数字政务小程序如何提升政务服务效率与公众参与度?
570
2022-11-27
在viewWillAppear函数中禁止左滑,viewWillDisappear开启左滑动产生进入下一个页面来回滑动造成无法点击点击按钮问题
- (void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; // 开启返回手势 if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { self.navigationController.interactivePopGestureRecognizer.enabled = NO; } self.navigationController.navigationBarHidden = YES;// if(self.isRedirectLoginFlag)// {// self.loginView.redirectUrl = self.redirectUrl;// FLDDLogVerbose(@"redirectUrl:%@, self.isRedirectLoginFlag:%d", self.redirectUrl, self.isRedirectLoginFlag);// self.isRedirectLoginFlag = NO;// }}- (void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; // 开启返回手势 if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { self.navigationController.interactivePopGestureRecognizer.enabled = YES; }}
解决方案: 在viewDidAppear添加禁止左滑动。
- (void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated];// // 开启返回手势// if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {// self.navigationController.interactivePopGestureRecognizer.enabled = NO;// }// self.navigationController.navigationBarHidden = YES;// if(self.isRedirectLoginFlag)// {// self.loginView.redirectUrl = self.redirectUrl;// FLDDLogVerbose(@"redirectUrl:%@, self.isRedirectLoginFlag:%d", self.redirectUrl, self.isRedirectLoginFlag);// self.isRedirectLoginFlag = NO;// }}- (void)viewDidAppear:(BOOL)animated{ [super viewDidAppear:animated]; // 开启返回手势 if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { self.navigationController.interactivePopGestureRecognizer.enabled = NO; }}- (void)viewWillDisappear:(BOOL)animated{ [super viewWillDisappear:animated]; // 开启返回手势 if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { self.navigationController.interactivePopGestureRecognizer.enabled = YES; }}
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~