JXBanner icon indicating copy to clipboard operation
JXBanner copied to clipboard

偶现闪退

Open YangYueFan opened this issue 2 years ago • 0 comments

Thread 1: "Attempted to scroll the collection view to an out-of-bounds item (1000) when there are only 1 items in section 0. Collection view: <UICollectionView: 0x14b009e00; frame = (0 0; 362 655); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x2821c6c70>; layer = <CAGradientLayer: 0x283da90a0>; contentOffset: {0, 0}; contentSize: {362, 117.5}; adjustedContentInset: {0, 0, 0, 0}; layout: <JXBanner.JXBannerLayout: 0x14aa2c130>; dataSource: <JXBanner.JXBanner: 0x14aa2bd10; frame = (10 47.5; 362 655); tag = 10; layer = <CAGradientLayer: 0x283da8f00>>>."

//MARK: - override override public func layoutSubviews() { super.layoutSubviews() if let itemSize = layout.params?.itemSize { let x = (bounds.size.width - itemSize.width) * 0.5 let y = (bounds.size.height - itemSize.height) * 0.5 placeholderImgView.frame = CGRect(x: x, y: y, width: itemSize.width, height: itemSize.height) }else { placeholderImgView.frame = bounds layout.params = layout.params } if pageCount > 0 { scrollToIndexPath(currentIndexPath, animated: false)---------> 这里 } }

YangYueFan avatar Aug 08 '22 04:08 YangYueFan