Skip to content

在RTL(从右到左)的布局下,自动滚动会出现问题,出现无限滚动到当前index,获取currentIndex会出错 #737

@NorthDogLi

Description

@NorthDogLi

问题:如果你把系统语言切换成阿拉伯等RTL的语言布局下,你的自动滚动会出现问题,获取currentIndex会出错,

因为在RTL下,系统的UICollectionView是左滑的,你的scrollToItemAtIndexPath没问题,但你通过index = (_mainView.contentOffset.x + _flowLayout.itemSize.width * 0.5) / _flowLayout.itemSize.width;去计算当前下标的时候就出现问题了,会变成原地无限循环。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions