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

自定义UICollectionViewLayout实现头部固定后,下拉刷新出现奇怪动画效果 #1592

Open
RisingSSR opened this issue Sep 15, 2023 · 2 comments

Comments

@RisingSSR
Copy link

          https://github.com/CoderMJLee/MJRefresh/assets/88606535/4f672147-007c-41f0-bb89-659b8ad3bbda

我继承 UICollectionViewLayout 自定义了一个layout,在实现的时候出现了上述情况

      let header = MJRefreshGifHeader {
          // self.mappy.clean()
          // self.request(sno: "2021215154")
      }
      .autoChangeTransparency(true)
      .set_refresh_sports()
      .ignoredScrollView(contentInsetTop: -58)
      .link(to: collectionView)
      
      header.isCollectionViewAnimationBug = true
      header.endRefreshingAnimationBeginAction = {
          collectionView.collectionViewLayout.finalizeLayoutTransition()
      }

而我的自定义的layout,是重写 layoutAttributesForSupplementaryView(ofKind:at:) 实现头部固定的,请问如何处理这种动画效果

Originally posted by @RisingSSR in #225 (comment)

@wolfcon
Copy link
Collaborator

wolfcon commented Sep 18, 2023

方便给一份 Layout 用来测试吗?

或者在 MJPinHeaderCollectionViewController 中增加部分测试代码以便于调试

@RisingSSR
Copy link
Author

方便给一份 Layout 用来测试吗?

或者在 MJPinHeaderCollectionViewController 中增加部分测试代码以便于调试

自定义Layout

你可以查看这个,但demo需要单独配置。

https://github.com/RisingSSR/RockSchedule/blob/main/ScheduleCollectionViewLayout.swift

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

2 participants