B4A Library [Lib] ScrollView2D

Informatix

Expert
Licensed User
Longtime User
The solution is more complicated than you think. Detecting if the finger is up (with the Reflection library) is not enough. I modified your example to show you how to do. I cannot guarantee that is 100% reliable but that seems to work fine.
 

Attachments

  • ScrollViewExample.zip
    7.9 KB · Views: 334

Brian Robinson

Active Member
Licensed User
Longtime User
The solution is more complicated than you think. Detecting if the finger is up (with the Reflection library) is not enough. I modified your example to show you how to do. I cannot guarantee that is 100% reliable but that seems to work fine.

Great work.... After some quick testing it seems to work perfectly. I have modified my code and the snap to position works as I was hoping it would. I really need to start looking how reflection can be applied so I can work things like this out myself. I just don't get time.

Many thanks for such a quick and thorough reply.
 

micheleBr

Member
Licensed User
Longtime User
Hi !
Is it possible use ScrollView2D (horizontal mode) inside a ScrollView (vertical mode)?
tnx!!
 

micheleBr

Member
Licensed User
Longtime User
Yes I know, I would like to build a special layout, something like in yahoo meteo app. (ScrollView2D/horizontally for "next hours section").
 

Attachments

  • horizontal_mode.png
    414.9 KB · Views: 317

Micholl

Member
Licensed User
Longtime User
Hi Informatix,
is version 1.1 from this thread the latest version of this lib?
Background: I have faced a problem while using flexible table from Klaus
and surprisingly found a higher version of this lib in my folder which has
caused the problem. Maybe I got this version from ULV?

Michael
 

Informatix

Expert
Licensed User
Longtime User
Recent versions of ULV do not include this Scrollview version. It was made for earlier versions of ULV and it is not needed any longer. You should remove it and use the one available in this forum.
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
Hello!

i have question with this lib and with GestureDetector specifically with the drag event. The drag begins, it moves (but way to little, almost nothing) the view(Button) but suddenly stops and begins to scroll the panel.

How can i prevent this from happening? the main idea is that if the users touches the button with the gesturedetector it only moves the button? many many thanks!!
 

Informatix

Expert
Licensed User
Longtime User
You can try the DisableTouchEventInterception function of ScrollView2D.
 

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
The solution with the reflection Library works like a charm, i tried too the DisableTouchEventInterception but it doesnt work, it seems that it works with the parent of the SV2D and not with the childs.

Thanks for answering!
 

corvo

Member
Licensed User
Longtime User
I got a problem whit the sv2d library....i need to create ad horizontal scroll view in a panel whit a graph (ONLY THIS PANEL NEED THE SCROLL, NO THE ENTIRE LAYOUT), this is my code

sv2d.Initialize(1000dip, 500dip, "scvTest")

pnlLine.AddView(sv2d, 0, 0, 100%x, 100%y)
Dim LD As LineData
LD.Initialize
LD.Target = pnlLine
Charts.AddLineColor(LD, Colors.Red)

It don't give any error but don't works, please any idea?
 

Informatix

Expert
Licensed User
Longtime User
If you use only the horizontal scroll, then use the HorizontalScrollView not ScrollView2D.
Anyway, you maybe face an OutOfMemory error. I don't know the Charts library so I cannot help.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…