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

偶现闪退 #30

Open
YangYueFan opened this issue Aug 8, 2022 · 0 comments
Open

偶现闪退 #30

YangYueFan opened this issue Aug 8, 2022 · 0 comments

Comments

@YangYueFan
Copy link

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)---------> 这里
}
}

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

No branches or pull requests

1 participant