美文网首页
ios uiscrollview 循环滚动

ios uiscrollview 循环滚动

作者: 荔枝lizhi_iOS程序猿 | 来源:发表于2021-06-09 16:46 被阅读0次

https://www.imooc.com/article/3372/

LoopScrollView

UIScrollView 循环滚动Demo

update

v1.1

忘记没用autolayout,后来也是按照iPhone6 plus尺寸默认初始化的,导致6+一下均不能正常滑动,感谢@_洪小瑶
scrollview.frame = CGRectMake(0, 20, width, height)

Demo 地址 LoopScrollview

Demo 演示

[图片上传失败...(image-cb1ae4-1623228951660)]

初始化

keypoint

1.按照3,1,2排列到UIScrollview容器上,conentOffset设置到第二屏

[图片上传失败...(image-380836-1623228951660)]

1 右滑循环

keypoint

1.1 正常scrollview滚动到2位置

[图片上传失败...(image-afdc76-1623228951660)]

1.2 让2处于中间位置,3位于2的右边,1位于2左边

1.2.1 2- 1 交换位置 【序号】

[图片上传失败...(image-50ffd3-1623228951660)]

1.2.2 1 - 3 交换位置

[图片上传失败...(image-9cc09-1623228951660)]

1.2.3 充值frame位置 按照 容器 3 1 2 放置 且让contentOffset位于第二屏幕

[图片上传失败...(image-6fec42-1623228951660)]

2 左滑循环

keypoint

2.1 正常scrollview滚动到3位置

[图片上传失败...(image-94e735-1623228951660)]

2.2 让3处于中间位置,1位于3的右边,2位于3左边

2.2.1 3 - 1 交换位置 【序号】

[图片上传失败...(image-5d7b1f-1623228951660)]

2.2.2 1 - 2 交换位置

[图片上传失败...(image-29229-1623228951660)]

2.2.3 充值frame位置 按照 容器 3 1 2 放置 且让contentOffset位于第二屏幕

[图片上传失败...(image-ca4ee5-1623228951660)]

相关文章

网友评论

      本文标题:ios uiscrollview 循环滚动

      本文链接:https://www.haomeiwen.com/subject/fhieeltx.html