Forum Xamarin.Android

how to implement OnTouchEvent

shaywshayw Member ✭✭

Hi
i have a button named upsec ,i would like to implement upsec.OnTouchEvent
How to proceed ?
Thanks

Tagged:

Best Answer

  • LeonLuLeonLu Member, Xamarin Team Xamurai
    Accepted Answer

    Do you want to achieve the touch event like following code in the xamarin.android?

     upsec.Touch += Upsec_Touch;
     private void Upsec_Touch(object sender, View.TouchEventArgs e)
            {
                // throw new NotImplementedException();
                switch (e.Event.Action)
                {
                    case MotionEventActions.Down:
    
                        break;
                    case MotionEventActions.Move:
    
                        break;
                }
    
            }
    

Answers

  • LeonLuLeonLu Member, Xamarin Team Xamurai
    Accepted Answer

    Do you want to achieve the touch event like following code in the xamarin.android?

     upsec.Touch += Upsec_Touch;
     private void Upsec_Touch(object sender, View.TouchEventArgs e)
            {
                // throw new NotImplementedException();
                switch (e.Event.Action)
                {
                    case MotionEventActions.Down:
    
                        break;
                    case MotionEventActions.Move:
    
                        break;
                }
    
            }
    
Sign In or Register to comment.