-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
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
iOS 13.3系统 底部弹出后侧滑返回动画异常 #16
Comments
更新一下刚刚断点得到的信息,问题出现在TLPercentDrivenInteractiveTransition.m里面
|
在iOS13中UIScreenEdgePanGestureRecognizer手势失效了,我自己加的一个pan手势。可能存在问题。 |
最近比较忙没时间维护,您可以自己修正一下。 (如果方便,修正后可以贡献下您的代码) |
抱歉,最近刚好在发版本,所以做的处理很简单,就是更改了一下判断方式,将新增的手势类别加进了判断条件中,因为只用到了相关的push动画更改,目前来看是测试正常的,但并没有进行全量的测试。 |
您好!
// 返回交互过渡完成的百分比。
- (CGFloat)percentForGesture:(UIPanGestureRecognizer *)gesture
{
// 因为视图控制器将作为动画的一部分在屏幕上或从屏幕上滑动,因此我们希望将计算建立在不移动视图的坐标空间:transitionContext.containerView。
UIView *containerView = self.transitionContext.containerView;
CGPoint locationInSourceView = [gesture locationInView:containerView];
CGFloat width = CGRectGetWidth(containerView.bounds);
CGFloat height = CGRectGetHeight(containerView.bounds);
CGFloat percent = 0.f;
//================== 修改开始 ====================
// 增加对TLScreenEdgePanGestureRecognizer的兼容
if ([gesture isMemberOfClass: [UIScreenEdgePanGestureRecognizer class]] ||
[gesture isMemberOfClass: NSClassFromString(@"TLScreenEdgePanGestureRecognizer")])
//================== 修改结束 ====================
{
if (self.edge == UIRectEdgeRight) {
percent = (width - locationInSourceView.x) / width;
} else {
// 垂直方向的转场以左侧滑作为依据
percent = locationInSourceView.x / width;
}
}else { // 用户自定义收拾
if (self.edge == UIRectEdgeRight) {
percent = (width - locationInSourceView.x) / width;
} else if (self.edge == UIRectEdgeLeft) {
// 垂直方向的转场以左侧滑作为依据
percent = locationInSourceView.x / width;
} else if (self.edge == UIRectEdgeBottom) {
percent = (height - locationInSourceView.y) / height;
}else if (self.edge == UIRectEdgeTop) {
percent = locationInSourceView.y / height;
}
}
if (_speedOfPercent >= 0.2) {
percent *= _speedOfPercent;
}
return percent;
} |
您可以用您的代码测试一下,因为时间紧迫,我就没有全面测试(但按照我的代码逻辑,因该是解决了的) |
辛苦作者大大,这个和我的解决方法完全一致,目前没有发现有额外的问题发生,我们可以对此进行持续跟进 |
iOS 13.3系统,利用
+ (instancetype)animatorWithSwipeType:(TLSwipeType)swipeType pushDirection:(TLDirection)pushDirection popDirection:(TLDirection)popDirection;
- (void)pushViewController:(UIViewController *)viewController animator:(id<TLAnimatorProtocol>)animator;
进行上下移动动画弹出的controller,在侧滑返回时,动画会出现异常,与低版本相比,会缺乏一个渐进过程,滑动非常小的幅度,动画幅度也会非常大
The text was updated successfully, but these errors were encountered: