Closed FukeYang closed 1 month 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) } }
+1
如何复现呢?
在15.0.1 和 15.0.2 系统上频繁点击Segmentview就出现了
hello @pujiaxin33 这个有预期什么时候修复嘛...
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) } }
请问这个是什么原理呢
iphone12, iphone12pro会出现这个问题