单击一次onsingletapup函数将正确执行,双击时onsingletapup和ondoubletap都将执行。

mGestureDetector = new GestureDetector(new GestureDetector.SimpleOnGestureListener() {
            @Override
            public void onLongPress(MotionEvent e)
            {

            }


            @Override
            public boolean onDoubleTap(MotionEvent e)
            {
                cameracontrolslayout.setVisibility(RelativeLayout.GONE);
                presetcontrolslayout.setVisibility(RelativeLayout.GONE);

                ViewFLipperButtonsLayout.setVisibility(RelativeLayout.VISIBLE);
                    ptzcontrolslayout.setVisibility(RelativeLayout.VISIBLE);
                return true;
            }

            @Override
            public boolean onSingleTapUp(MotionEvent arg0)
            {
                // TODO Auto-generated method stub

                cameracontrolslayout.setVisibility(RelativeLayout.VISIBLE);
                presetcontrolslayout.setVisibility(RelativeLayout.VISIBLE);


            return false;
            }

            @Override
            public boolean onDown(MotionEvent e)
            {
                return true;
            }

       });

有人能帮我解决这个问题吗?

最佳答案

为什么不使用onSingleTapConfirmed,而不是onSingleTapUp,但是您的布局将在录制时可见。

关于android - Android:onSingleTapUp和onDoubleTap上的问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12524709/

10-08 23:46