小编Ste*_*ter的帖子

Android ACTION_UP 和 ACTION_DOWN 同时调用

我正在使用触摸事件进行输入。MotionEvent.ACTION_DOWN 和 MotionEvent.ACTION_UP 都会在按下期间调用。当我的手指从表面抬起时,它应该只调用 ACTION_UP 。他们同时被召唤。请参阅以下代码和 logcat 输出。

\n\n
    public boolean onTouchEvent(MotionEvent e) {\n    // MotionEvent reports input details from the touch screen\n    // and other input controls. In this case, you are only\n    // interested in events where the touch position changed.\n\n    float x = e.getX();\n    float y = e.getY();\n\n    switch (e.getAction()) {\n        case MotionEvent.ACTION_DOWN:\n            mRenderer.scanButtonsDown(x, y);\n\n            Log.i("Touch", "Action Down Case");\n\n        case MotionEvent.ACTION_UP:\n            mRenderer.scanButtonsUp(x, y);\n\n            Log.i("Touch", "Action Up Case");\n\n    }\n\n    mPreviousX = x;\n    mPreviousY = y;\n    return true;\n}\n
Run Code Online (Sandbox Code Playgroud)\n\n …

android

3
推荐指数
1
解决办法
2212
查看次数

用VBO画线时,如何指定索引?

绘制线条列表时遇到问题。指数发挥作用吗?如果他们这样做,他们在索引缓冲区中的顺序是什么?

我在网上找不到可靠的例子。

opengl lines indices

3
推荐指数
1
解决办法
1605
查看次数

标签 统计

android ×1

indices ×1

lines ×1

opengl ×1