I need to create several views dynamically.
As there will be several views, I used a scrollview.
However, after creating the views, I don't know how to resize the panel so that the user can scroll it to the end, so that he can see any view he wants.
Below is my code and the sample project is attached.
svcInspecao is in "inspecao" layout.
pnlFormulario is in "meapague" layout.
lblPergunta is in "campotexto" layout.
As there will be several views, I used a scrollview.
However, after creating the views, I don't know how to resize the panel so that the user can scroll it to the end, so that he can see any view he wants.
Below is my code and the sample project is attached.
svcInspecao is in "inspecao" layout.
pnlFormulario is in "meapague" layout.
lblPergunta is in "campotexto" layout.
My code::
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private svcInspecao As ScrollView
Private pnlFormulario As Panel
Private lblPergunta As Label
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("inspecao")
svcInspecao.Panel.LoadLayout("meapague")
Dim ultimo As Int = 100dip
For x = 1 To 10
Dim p As Panel
p.Initialize("")
p.Width = pnlFormulario.Width
p.Height = 90dip
p.LoadLayout("campoTexto")
lblPergunta.Text = "controle " & x
pnlFormulario.Height = pnlFormulario.Height + 90dip
pnlFormulario.AddView(p, 0, ultimo, pnlFormulario.Width - 11dip, 90dip)
ultimo = ultimo + 100dip
Next
End Sub