We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当要弹的view的高度小于屏幕高度一半的时候,拖拽结束时,即使放手时view的位置和拖拽前一样,判定的任然是需要消失。应该在拖拽手势结束时比较的是弹框view离原来的位置拖动了多少比例,即self.maskView.bounds.size.height * self.panDismissRatio这里不应该用maskView的高度去比较
The text was updated successfully, but these errors were encountered:
应不应该消失与maskView是没关系,要看弹框view相比于自己原来的位置移动的比例,我是这样写的 BOOL isDismissNeeded = NO; switch (self.layoutType) { case zhPopupLayoutTypeTop: { isDismissNeeded = - self.view.frame.origin.y > self.view.frame.size.height * self.panDismissRatio; } break; case zhPopupLayoutTypeLeft: { isDismissNeeded = - self.view.frame.origin.x > self.view.bounds.size.width * self.panDismissRatio; } break; case zhPopupLayoutTypeBottom: { isDismissNeeded = (self.maskView.bounds.size.height - self.view.frame.origin.y) < self.view.frame.size.height * (1 - self.panDismissRatio); } break; case zhPopupLayoutTypeRight: { isDismissNeeded = (self.maskView.bounds.size.width - self.view.frame.origin.x) < self.view.frame.size.width * (1 - self.panDismissRatio); ; } break; case zhPopupLayoutTypeCenter: { if (_directionalVertical) { isDismissNeeded = CGRectGetMinY(g.view.frame) > self.maskView.bounds.size.height * self.panDismissRatio; [self directionalUnlock]; } } break; default: break; }
Sorry, something went wrong.
No branches or pull requests
当要弹的view的高度小于屏幕高度一半的时候,拖拽结束时,即使放手时view的位置和拖拽前一样,判定的任然是需要消失。应该在拖拽手势结束时比较的是弹框view离原来的位置拖动了多少比例,即self.maskView.bounds.size.height * self.panDismissRatio这里不应该用maskView的高度去比较
The text was updated successfully, but these errors were encountered: