iOS Question The pressing effect is lost in SwiftButton

angel_

Well-Known Member
Licensed User
Longtime User
When canceling the click event from the custom list view I lose the depth effect when pressing the button, I'm using the code of this thread

 

Attachments

  • DraggableView3.zip
    173.7 KB · Views: 262

Semen Matusovskiy

Well-Known Member
Licensed User
A purpose of Erel's code is to distinguish an "action" in Panel_Touch (Action As Int, X As Float, Y As Float). If a touch is cancelled, Action will be 4 instead of 1 (ACTION_UP).
In some situations this is useful. But your code should be ready to receive 4 instead of 1.

If to open a source code inside XUI Views.b4xlib, SwiftButton in p_Touch subroutine processes TOUCH_ACTION_DOWN, TOUCH_ACTION_MOVE and TOUCH_ACTION_UP. If action = 4, SwiftButton does nothing (so button remains 'pressed').
 
Upvote 0

angel_

Well-Known Member
Licensed User
Longtime User
A purpose of Erel's code is to distinguish an "action" in Panel_Touch (Action As Int, X As Float, Y As Float). If a touch is cancelled, Action will be 4 instead of 1 (ACTION_UP).
In some situations this is useful. But your code should be ready to receive 4 instead of 1.
I understand, thank you

If to open a source code inside XUI Views.b4xlib, SwiftButton in p_Touch subroutine processes TOUCH_ACTION_DOWN, TOUCH_ACTION_MOVE and TOUCH_ACTION_UP. If action = 4, SwiftButton does nothing (so button remains 'pressed').
This is the last thing that I want to do, What would you do?
 
Upvote 0
Top