pujiaxin33 / JXSegmentedView

A powerful and easy to use segmented view (segmentedcontrol, pagingview, pagerview, pagecontrol, categoryview) (腾讯新闻、今日头条、QQ音乐、网易云音乐、京东、爱奇艺、腾讯视频、淘宝、天猫、简书、微博等所有主流APP分类切换滚动视图)
MIT License
2.68k stars 369 forks source link

IOS15,点击tab切换界面会卡住 #184

Closed FukeYang closed 1 month ago

FukeYang commented 2 years ago

iphone12, iphone12pro会出现这个问题

zhangyuge commented 2 years ago

setContentOffset animated 为true时候卡顿 JXSegmentedView 574行修改如下 if contentScrollView != nil && (selectedType == .click || selectedType == .code) { // contentScrollView!.setContentOffset(CGPoint(x: contentScrollView!.bounds.size.widthCGFloat(index), y: 0), animated: isContentScrollViewClickTransitionAnimationEnabled) if isContentScrollViewClickTransitionAnimationEnabled { UIView.animate(withDuration: 0.25) { self.contentScrollView?.contentOffset = CGPoint(x: self.contentScrollView!.bounds.size.widthCGFloat(index), y: 0) } }else{ contentScrollView?.contentOffset = CGPoint(x: contentScrollView!.bounds.size.width*CGFloat(index), y: 0) } }

BeingCode commented 2 years ago

+1

pujiaxin33 commented 2 years ago

如何复现呢?

zjinhu commented 2 years ago

在15.0.1 和 15.0.2 系统上频繁点击Segmentview就出现了

ruins-hacker commented 2 years ago

hello @pujiaxin33 这个有预期什么时候修复嘛...

DNC-7 commented 2 years ago

w 574行修改如下 if contentScrollView != nil && (selectedType == .click || selectedType == .code) { // contentScrollView!.setContentOffset(CGPoint(x: contentScrollView!.bounds.size.width_CGFloat(index), y: 0), animated: isContentScrollViewClickTransitionAnimationEnabled) if isContentScrollViewClickTransitionAnimationEnabled { UIView.animate(withDuration: 0.25) { self.contentScrollView?.contentOffset = CGPoint(x: self.contentScrollView!.bounds.size.width_CGFloat(index), y: 0) } }else{ contentScrollView?.contentOffset = CGPoint(x: contentScrollView!.bounds.size.width*CGFloat(index), y: 0) } }

请问这个是什么原理呢