JXCategoryView icon indicating copy to clipboard operation
JXCategoryView copied to clipboard

iOS15 点击切换时卡顿

Open qingshanbugai opened this issue 3 years ago • 5 comments

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

https://user-images.githubusercontent.com/7610726/138453006-9a08d550-6be0-43c3-a104-42386227b2d5.mp4

qingshanbugai avatar Oct 22 '21 12:10 qingshanbugai

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

qingshanbugai avatar Oct 25 '21 09:10 qingshanbugai

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

pujiaxin33 avatar Nov 20 '21 12:11 pujiaxin33

同上问题,iphone13 pro ,iOS15.0.2

even-cheng avatar Nov 26 '21 01:11 even-cheng

找到个了解决方式,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)]; }]; 是否需要动画自行判断

YifengBai avatar Nov 30 '21 06:11 YifengBai

经测试 楼上的方法 可行 , 本人机型 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(targetIndexself.contentScrollView.bounds.size.width, 0)]; } 这样子可以兼容切换时 不用动画/需要动画 的场景

damu-mu avatar Jun 21 '22 13:06 damu-mu