I am trying to display some rows of information. Each row has a row number followed by numbers, e.g.
...
123 4 5 6 7 8 1 2 3
124 4 6 5 8 7 2 1 3
...
There could be up to 6000 rows and I want to be able to scroll up and down.
I've implemented this in VB6 using a fixed picture and drawing just 30 rows to the picture at a time, with a vertical scrollbar controlling which 30 rows are displayed.
I thought I would be able to draw all 6000 rows to a canvas on a scrollview panel of the requisite height, and just scroll the view up and down, but I seem to be limited to 100 or 200 rows.
I don't get any error messages when trying, say, a 300-row data set, but get nothing displayed apart from a dark grey scrollview with a little indicator on the right hand side of the screen sliding up and down.
The following code illustrates the issue:
Sub Globals
Dim scv1 As ScrollView
Dim cvs1 As Canvas
End Sub
Sub Activity_Create(FirstTime As Boolean)
scv1.Initialize(0)
Activity.AddView(scv1,0,0,100%x,100%y)
scv1.Panel.Width=scv1.Width
scv1.Panel.Height=scv1.Height * 7 'OK with * 6
Dim panelcolor As ColorDrawable
panelcolor.Initialize(Colors.RGB(255,255,192),10)
scv1.Panel.Background=panelcolor
cvs1.Initialize(scv1.Panel)
Dim row As Int
For row = 1 To 2000
cvs1.DrawText(row,0,row * 20,Typeface.DEFAULT,12,Colors.Red,"LEFT")
Next
scv1.Panel.Invalidate
scv1.Invalidate
Activity.Invalidate
End Sub
If I make the scrollview panel 6 times the screen height this works OK, but get a blank display for 7 times.
B4A 5.8. Target is BLU ENERGY DIAMOND phone, Android 6
...
123 4 5 6 7 8 1 2 3
124 4 6 5 8 7 2 1 3
...
There could be up to 6000 rows and I want to be able to scroll up and down.
I've implemented this in VB6 using a fixed picture and drawing just 30 rows to the picture at a time, with a vertical scrollbar controlling which 30 rows are displayed.
I thought I would be able to draw all 6000 rows to a canvas on a scrollview panel of the requisite height, and just scroll the view up and down, but I seem to be limited to 100 or 200 rows.
I don't get any error messages when trying, say, a 300-row data set, but get nothing displayed apart from a dark grey scrollview with a little indicator on the right hand side of the screen sliding up and down.
The following code illustrates the issue:
Sub Globals
Dim scv1 As ScrollView
Dim cvs1 As Canvas
End Sub
Sub Activity_Create(FirstTime As Boolean)
scv1.Initialize(0)
Activity.AddView(scv1,0,0,100%x,100%y)
scv1.Panel.Width=scv1.Width
scv1.Panel.Height=scv1.Height * 7 'OK with * 6
Dim panelcolor As ColorDrawable
panelcolor.Initialize(Colors.RGB(255,255,192),10)
scv1.Panel.Background=panelcolor
cvs1.Initialize(scv1.Panel)
Dim row As Int
For row = 1 To 2000
cvs1.DrawText(row,0,row * 20,Typeface.DEFAULT,12,Colors.Red,"LEFT")
Next
scv1.Panel.Invalidate
scv1.Invalidate
Activity.Invalidate
End Sub
If I make the scrollview panel 6 times the screen height this works OK, but get a blank display for 7 times.
B4A 5.8. Target is BLU ENERGY DIAMOND phone, Android 6