- (voID)scrollVIEwDIDEndDecelerating:(UIScrollVIEw *)scrollVIEw{ int index = 0; for (TextCell * t in [_tabbarCollectionVIEw visibleCells]) { if ((t.center.x>0)&&(t.center.x<[[UIScreen mainScreen]bounds].size.wIDth)) { [_tabbarCollectionVIEw scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0] atScrollposition:UICollectionVIEwScrollpositionCenteredHorizontally animated:YES]; break; } index++; }}解决方法 您可以为集合视图打开分页,它将具有该效果.转到添加了集合的xib文件或故事板,并在其属性下启用分页. 总结
以上是内存溢出为你收集整理的ios – UICollectionView水平滚动全部内容,希望文章能够帮你解决ios – UICollectionView水平滚动所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)