即使我自定义ScrollView
并覆盖dispatchKeyEvent
功能,它仍会滚动。
如果我在键盘上单击向下/向上键,我想要它不滚动,但是当我使用鼠标时滚动。有什么办法吗?
public class UserDefinedScrollView extends ScrollView {
private static final String LOG_TAG = "UserDefinedScrollView";
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// TODO Auto-generated method stub
//return super.dispatchKeyEvent(event);
Log.i(LOG_TAG, "dispatchKeyEvent "+event.getKeyCode());
return false;
}
public UserDefinedScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}
}