Android TimePicker (Wheel Style) not responding correctly to flick gestures inside ScrollView

前端 未结 2 1311
南旧
南旧 2020-12-08 22:58

I have a dialog box that contains a Scrollview, which contains a layout with two TimePickers.

The timepickers are the newer style ones, what\'s in ICS.

The p

2条回答
  •  执念已碎
    2020-12-08 23:36

    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

    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;
    }
    

提交回复
热议问题