Android Question How to scroll left and right

winjiadh

Active Member
Licensed User
Longtime User
I use the ScrollView.Panel
in tje Globals
B4X:
Sub Globals
    Private Pan1 As Panel
    Dim DLine As Canvas
    Private SV As ScrollView
   
    Dim Stroke As Float                : Stroke = 1dip
    Dim Dx,Dy As Float
End Sub
In the Activity_Create
B4X:
Sub Activity_Create(FirstTime As Boolean)

    Dy=Activity.Height:Dx=Activity.Width
    SV.Initialize(Dy)
    Activity.AddView(SV,10dip,10dip,0.5*Dx,0.5*Dy)
    Pan1.Initialize("")
    SV.Panel.AddView(Pan1,0,0,0.5*Dx,0.5*Dy)
   
    DLine.Initialize(Pan1)

    DrawGird
End Sub
only scroll in vertical,I can touch it up and down.
but I want the Gird scroll in horizontal, how to do it.
thanks
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
1. Use xCustomListview insteal of ListView. xclv = lv with eXtended Features
2. Set the Orientation to Horizontal
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
No. It is you who want this; not me. I do not expect it to be complicated.

1. Check the Tutorial

2. Use the Forumsearch; i remember there is somewhere an example of an Horizontal xCLV posted in the past...
 
Last edited:
Upvote 0

winjiadh

Active Member
Licensed User
Longtime User
No. It is you who want this; not me. I do not expect it to be complicated.

1. Check the Tutorial

2. Use the Forumsearch; i remember there is somewhere an example of an Horizontal xCLV posted in the past...
Frist, thanks you Replay
And, Do you mean to say, the ScrollView.Panel is only scroll in vertical can't sroll in horizontal.
thanks again for your replay
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Hi, as far as I recall you have both a ScrollView and an HorizontalScrollView to choose from.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
ScrollView scrolls only vertically, HorizontalScrollView scrolls only horizontally.
xCustomScrollView can scroll either vertically or horizontally but not in both at the same time.
The ScrollView2D library allows scrolling in both directions.
 
Upvote 0
Top