Dim sv As ScrollView
Dim hsv As HorizontalScrollView
sv.Initialize(pnlGm.Height)
pnlGm.AddView(sv, 0, 0, pnlGm.Width, pnlGm.Height)
sv.Color = Colors.RGB(240,240,240)
sv.Panel.Color = Colors.RGB(240,240,240)
sv.Panel.Width = sv.Width
sv.Panel.Height = l ' l is the calculated height I need
hsv.Initialize(pnlGm.Height, "hsv")
sv.Panel.AddView(hsv, 0, 0, sv.Width, sv.Panel.Height)
hsv.Color = Colors.RGB(240,240,240)
hsv.Panel.Color = Colors.RGB(240,240,240)
hsv.Panel.Height = hsv.Height
hsv.Panel.Width = l ' l is also the calculated with I need
k = 0
For i=0 To r-1
For j=0 To c-1
Dim ptile As Panel
Dim cd As ColorDrawable
ptile.Initialize("ptile")
cd.Initialize(Colors.RGB(180,180,180), 5)
ptile.Background = cd
ptile.Tag = k
tl = j * tsize + (j + 1) * tspc
tt = i * tsize + (i + 1) * tspc
tlist.Add(ptile)
hsv.Panel.AddView(ptile, tl, tt, tsize, tsize)
k = k + 1
Next
Next