0
在我们的应用程序中,我们使用Android轮毂库。问题在Galaxy SII上。只有当用户触摸它时,轮子才会工作,将他的手指移到侧面(轮子外面),然后向上或向下滚动。有没有人可以解决这个问题?Samsung Galaxy S2上的Android轮毂ICS
在我们的应用程序中,我们使用Android轮毂库。问题在Galaxy SII上。只有当用户触摸它时,轮子才会工作,将他的手指移到侧面(轮子外面),然后向上或向下滚动。有没有人可以解决这个问题?Samsung Galaxy S2上的Android轮毂ICS
这是一个kankan android-wheel库的bug。在611行的WheelView.java中,将switch语句更改为以下内容:
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN: //added to fix problem
case MotionEvent.ACTION_MOVE:
if (getParent() != null) {
getParent().requestDisallowInterceptTouchEvent(true);
}
break;
case MotionEvent.ACTION_UP:
if (getParent() != null) { //added to fix problem, this may be uneeded
getParent().requestDisallowInterceptTouchEvent(false);
}
if (!isScrollingPerformed) {
int distance = (int) event.getY() - getHeight()/2;
if (distance > 0) {
distance += getItemHeight()/2;
} else {
distance -= getItemHeight()/2;
}
int items = distance/getItemHeight();
if (items != 0 && isValidItemIndex(currentItem + items)) {
notifyClickListenersAboutClick(currentItem + items);
}
}
break;
}
Thx,我会尝试它;) – cecan 2013-02-12 16:56:26