且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android的TimePicker(轮式)没有正确响应轻弹内滚动型手势

更新时间:2023-10-29 22:56:46

我使用的时候河洛主题,这里是我找到了解决办法有同样的问题:https://groups.google.com/forum/?fromgroups#!topic/android-developers/FkSfJI6dH8w

I had the same problem when using the Holo theme, and here is where I found the solution: https://groups.google.com/forum/?fromgroups#!topic/android-developers/FkSfJI6dH8w

您必须实现自定义的DatePicker或TimePicker并覆盖下面的方法:

You must implement your custom DatePicker or TimePicker and override the following method:

@Override
public boolean onInterceptTouchEvent(MotionEvent ev)
{
    if (ev.getActionMasked() == MotionEvent.ACTION_DOWN)
    {
        ViewParent p = getParent();
        if (p != null)
            p.requestDisallowInterceptTouchEvent(true);
    }

    return false;
}