How to use View.OnTouchListener instead of onClick

后端 未结 4 2073
别那么骄傲
别那么骄傲 2020-11-27 02:42

I\'m developing an Android 2.2.2 application for a client and he wants to do the following:

Now I have a button with an onClick event but he doesn\'t like, he wants

4条回答
  •  醉话见心
    2020-11-27 03:29

    OnClick is triggered when the user releases the button. But if you still want to use the TouchListener you need to add it in code. It's just:

    myView.setOnTouchListener(new View.OnTouchListener()
    {
        // Implementation;
    });
    

提交回复
热议问题