WheelView
WheelView copied to clipboard
在htc手机上无法滚动修正选中位置的偏移量
在htc one(m7)测试手机上方向滚动后无法修正选中位置的偏移量,发现在这个手机上smoothScrollBy需要放在handler里去post处理才能实现,但是用着个方法发现另一个问题就是在滚动偏移量的过程中没法操作滚轮,必须处理完以后才可以再次操作,不是很跟手 `if (Math.abs(deltaY) < mItemH / 2) {
// distance = getSmoothDistance(deltaY); distance = (int)deltaY; WheelView.this.post(new Runnable() { @Override public void run() { smoothScrollBy(distance, WheelConstants.WHEEL_SMOOTH_SCROLL_DURATION); } }); } else { distance = (int)(mItemH + deltaY); // distance = getSmoothDistance(mItemH + deltaY); WheelView.this.post(new Runnable() { @Override public void run() { smoothScrollBy(distance, WheelConstants.WHEEL_SMOOTH_SCROLL_DURATION); } }); }`
这是我现在的临时方案,不知道是否有其他解决方法