G giagia Member Licensed User Aug 13, 2020 #1 I'm converting my b4a app in b4i. I have a line where I use GestureDetector for activate a LongPress event. Now I need to convert this method in b4i. but b4i don't have it. I have a Scrollview that include any line of Label. If longclick on this label I have to run a functions. What is the right way to follow? I used the following code for "drag" B4X: Sub myScrollView_Touch(Action As Int, X As Float, Y As Float) Select Action Case 0 ' down Case 1 ' Up Case 2 ' move / drag End Sub If use this for longClick (Case 0) then Case 0 run the Case 1 ('up') but this it is a problem for my use.
I'm converting my b4a app in b4i. I have a line where I use GestureDetector for activate a LongPress event. Now I need to convert this method in b4i. but b4i don't have it. I have a Scrollview that include any line of Label. If longclick on this label I have to run a functions. What is the right way to follow? I used the following code for "drag" B4X: Sub myScrollView_Touch(Action As Int, X As Float, Y As Float) Select Action Case 0 ' down Case 1 ' Up Case 2 ' move / drag End Sub If use this for longClick (Case 0) then Case 0 run the Case 1 ('up') but this it is a problem for my use.
Semen Matusovskiy Well-Known Member Licensed User Aug 13, 2020 #2 LongClick or LongPress ? LongClick does not require efforts. You can specify event prefix in Initialize (for example, Label1.Initialize ("Label1") and to use Sub Label1_LongClick. LongPress requies a gesture https://developer.apple.com/documentation/uikit/uilongpressgesturerecognizer?language=objc Upvote 0
LongClick or LongPress ? LongClick does not require efforts. You can specify event prefix in Initialize (for example, Label1.Initialize ("Label1") and to use Sub Label1_LongClick. LongPress requies a gesture https://developer.apple.com/documentation/uikit/uilongpressgesturerecognizer?language=objc
G giagia Member Licensed User Aug 13, 2020 #3 Semen Matusovskiy said: LongClick or LongPress ? LongClick does not require efforts. You can specify event prefix in Initialize (for example, Label1.Initialize ("Label1") and to use Sub Label1_LongClick. LongPress requies a gesture https://developer.apple.com/documentation/uikit/uilongpressgesturerecognizer?language=objc Click to expand... Thank you. in my case LongClick it's perfect . Upvote 0
Semen Matusovskiy said: LongClick or LongPress ? LongClick does not require efforts. You can specify event prefix in Initialize (for example, Label1.Initialize ("Label1") and to use Sub Label1_LongClick. LongPress requies a gesture https://developer.apple.com/documentation/uikit/uilongpressgesturerecognizer?language=objc Click to expand... Thank you. in my case LongClick it's perfect .