Hi, so, what can I use to replace a HorizontalScrollView, which also allows to add panels, images, labels, buttons, etc. and also allows horizontal scroll.
Thank you.
Because I want to try another view.
It's just that "weird" things happen, although it's probably because I'm not using it correctly.
For example, why this "height= -1" ?
This is a reduced code, I have deleted a lot of things so as not to confuse:
B4X:
Sub CargarFamilias2 As ResumableSub
Dim const cSql As String = $"select codigo, nombre from tbFamilias where length(nombre)>0 order by codigo"$
Dim iItemAncho=160, iTextSize=iItemAnchoCata As Int
Dim QG As Cursor
iTextSize = 18
hsvFamilias.Panel.RemoveAllViews
QG = globales.DBconex.ExecQuery( cSql )
hsvFamilias.Panel.Width = (iItemAncho * QG.RowCount)
For i=0 To QG.RowCount-1
QG.Position = i
Dim btFa As Button
btFa.Initialize("btFa")
btFa.TextSize = iTextSize
btFa.Text = QG.GetString("nombre").Trim
hsvFamilias.Panel.AddView( btFa, iItemAncho*i, 0, iItemAncho, hsvFamilias.Panel.Height )
Next
If QG.IsInitialized Then QG.Close
'
Return Null
End Sub
But the panel has 500 by default, as far as I know. Because you have deleted what is contained in the panel, but you don't delete the panel.
And the button (each button) that I add, what is its height, if I have not indicated any?
The thing is that if I want to know later how high is the button, or a label, it tells me zero, when it is not.
Surely I am not doing something right.