Android的TimePicker(轮式)没有正确响应轻弹内滚动型手势 [英] Android TimePicker (Wheel Style) not responding correctly to flick gestures inside ScrollView

查看:149
本文介绍了Android的TimePicker(轮式)没有正确响应轻弹内滚动型手势的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含滚动视图,它包含有两个TimePickers布局的对话框。

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

在timepickers是较新款式的,什么是在ICS。

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

现在的问题是,他们似乎对焦点,当你通过拖动轮,或轻弹它改变的时候打。它将改变的时候一点点,然后布局将滚动代替。

The problem is that they seem to fight for focus when you change the time by dragging the wheel, or flicking it. It will change the time just a little, and then the layout will scroll instead.

任何想法? 先谢谢了。

Any ideas? Thanks in advance.

推荐答案

我使用的时候河洛主题,这里是我找到了解决办法有同样的问题:<一href="https://groups.google.com/forum/?fromgroups#!topic/android-developers/FkSfJI6dH8w">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;
}

这篇关于Android的TimePicker(轮式)没有正确响应轻弹内滚动型手势的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆