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

getSelectedItem 获取位置异常 #70

Open
18702953620 opened this issue Feb 23, 2021 · 0 comments
Open

getSelectedItem 获取位置异常 #70

18702953620 opened this issue Feb 23, 2021 · 0 comments

Comments

@18702953620
Copy link

主要属性设置

                app:awv_itemsVisibleCount="7"
                app:awv_lineSpace="1.5"
                app:awv_textsize="17"

当数据只有2条时(3条以上正常)preCurrentIndex计算有误
onDraw方法

change = (int) (totalScrollY / (lineSpacingMultiplier * itemTextHeight));
        preCurrentIndex = initPosition + change % items.size();

其中,totalScrollY为133,lineSpacingMultiplier为1.5 ,itemTextHeight为89,此时change计算结果为0,preCurrentIndex结果异常

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

1 participant