-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
使用rem导致非整数itemHeight带来的误差 #206
Comments
animation 这个确实可以先清除一下 |
@TotooriaHyperion 是的我也遇到这样问题,rem适配,item越多,误差越大 |
@1657413883 你可以先参照我上面先乘后除的方法临时处理一下。也可以使用平面滚动 + snap(实际上wheel是比较消耗性能的。因为目前的实现中,所有的item都会有rotate行为。) |
恩,rem 布局看来确实有问题 |
https://codepen.io/torihyper/pen/wqbYZN
移动端用户大多使用rem来设置高度,经常产生非整数的itemHeight,
应该根据scrollerHeight和items.length采用先乘后除的方式来消除误差。
https://codepen.io/torihyper/pen/vJodEO
这个是iscroll就一直有的bug,由于绝大多数场景使用的是transition,所以一般不会遇到。
开始一个新的animation之前,要清除旧的animation,否则如果旧animation的结束时间早于新animation则会导致最终定位为旧animation,并且画面闪动。
比如,在index-list的demo中,如果强制关闭transition(useTransition: false)那么在动画结束之前,点击右侧index的操作将被动画效果覆盖。
关联pr:#184
The text was updated successfully, but these errors were encountered: