ios - 如何在滚动另一个 UICollectionView 时自动滚动 UICollectionView?
问题描述
我在 ViewController 中有两个集合视图。需要在用户滚动底部 UICollectionView 时自动滚动顶部 collectionView。
解决方案
你可以试试
func scrollViewDidScroll(_ scrollView: UIScrollView) {
topCollection.contentOffset = scrollView.contentOffset
bottomCollection.contentOffset = scrollView.contentOffset
}
推荐阅读
- reactjs - 在 ReactJS 中使用 Fetch 进行 POST 调用(带有标头和请求正文)
- geometry - 是否有一些算法可以匹配来自候选多边形集的多边形?
- php - 如何在 PHP 中获取 Typo3 模板常量的值?
- php - 将图像转换为背景图像
- sql-server - 如何使用 SSIS 压缩文件,然后转到 Azure 数据湖(无需先导出平面文件)
- php - 在 html 视频源中需要在特定时间播放视频
- html - 如何设置按钮在图片边缘的位置?
- c# - 在 ASP.NET 上管理异步、非 CPU 密集型任务
- memory-management - vue v-if 是如何处理内存的?
- javascript - 发送 twilio SMS 消息的 Google 表格脚本在手动运行时有效,但在时间触发时失败