Skip to content
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

iOS15 点击切换时卡顿 #411

Closed
qingshanbugai opened this issue Oct 22, 2021 · 6 comments
Closed

iOS15 点击切换时卡顿 #411

qingshanbugai opened this issue Oct 22, 2021 · 6 comments
Labels
question Further information is requested

Comments

@qingshanbugai
Copy link

bug提交前阅读
1.请先仔细阅读文档,尤其是【其他注意事项】文档,里面有常见问题的解决方案;
2.请先搜索已有的Issues,尝试找到相同问题的讨论;
3.请先阅读相关类的API、源码,尝试从源码找到答案;
4.如果以上步骤都未能解决你的疑问,欢迎提交ISSUE;

bug描述
iOS15,iPhone12Mini,点击切换tab时卡顿,模拟器和低版本系统手机没有这个问题

版本号
1.JXCategoryView版本号:1.5.9
2.手机系统版本号:iOS15.0.2
3.手机型号:iPhone 12 mini

复现步骤

  1. 遇到问题的相关效果、类是:JXCategoryListContainerView
    2.具体的操作步骤是:点击切换tab

截图、GIF

QQ20211022-202219.mp4
@qingshanbugai
Copy link
Author

通过关闭动画,暂时解决了:JXCategoryBaseView:543行
[self.contentScrollView setContentOffset:CGPointMake(targetIndexself.contentScrollView.bounds.size.width, 0) animated:self.isContentScrollViewClickTransitionAnimationEnabled];
修改成[self.contentScrollView setContentOffset:CGPointMake(targetIndex
self.contentScrollView.bounds.size.width, 0)];

@pujiaxin33
Copy link
Owner

通过demo测试,这应该是iOS 15 iphone mini 系统手机自己的问题,写一个最简单的demo,进行视图动画,也会出现动画残影的问题。

@pujiaxin33 pujiaxin33 added the question Further information is requested label Nov 20, 2021
@even-cheng
Copy link

同上问题,iphone13 pro ,iOS15.0.2

@YifengBai
Copy link

YifengBai commented Nov 30, 2021

找到个了解决方式,JXCategoryBaseView:543行
[self.contentScrollView setContentOffset:CGPointMake(targetIndexself.contentScrollView.bounds.size.width, 0) animated:self.isContentScrollViewClickTransitionAnimationEnabled];
修改成
[UIView animateWithDuration:0.2 animations:^{
[self.contentScrollView setContentOffset:CGPointMake(targetIndex*self.contentScrollView.bounds.size.width, 0)];
}];
是否需要动画自行判断

@damu-mu
Copy link

damu-mu commented Jun 21, 2022

经测试 楼上的方法 可行 , 本人机型 iPhone 12 Pro Max . 15.0.2的系统. 快速点击切换的时候,会卡顿

if (self.isContentScrollViewClickTransitionAnimationEnabled) {
[UIView animateWithDuration:0.2 animations:^{
[self.contentScrollView setContentOffset:CGPointMake(targetIndexself.contentScrollView.bounds.size.width, 0)];
}];
}else {
[self.contentScrollView setContentOffset:CGPointMake(targetIndex
self.contentScrollView.bounds.size.width, 0)];
}
这样子可以兼容切换时 不用动画/需要动画 的场景

@pujiaxin33
Copy link
Owner

可以尝试把isContentScrollViewClickTransitionAnimationEnabled设置为false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants