Hi,
I'm using the following code:
Everything works great but Pan(6), I just can't make items show up. In this case (my last test) I've tried to instantiate a ScrollView on the fly instead of loading a layout (a clone of the one loaded in Pan(5)). The items are loaded (I mean the db is populated) but the yellow ScrollView sc is the only thing that shows up. If I load the items in the scrollview of Pan(5) everything works fine.
Inspecting all this stuff using the debugger everything gets loaded correctly inside the ClsCheckList.
Where am I wrong?
Thank you in advance!
Raffaele
I'm using the following code:
B4X:
Dim Container As AHPageContainer
Dim Pager As AHViewPager
Dim Pan(7) As Panel
Dim C As Cursor
Dim lst, lstTratt As ClsCheckList
'Pan from 0 to 4 are loaded using static layouts
Pan(5).LoadLayout("CheckListScrollView")
lst.Initialize(Me, ScrollView1, "lst_CheckedChange", "", "", 1dip)
lst.ExtensionColor=Colors.Black
lst.BackgroundColor=Colors.Transparent
lst.DividerColor=Colors.ARGB(255,0,0,0)
C=Main.SQL.ExecQuery("SELECT TIPO FROM PATOLOGIE ORDER BY TIPO")
For b=0 To C.RowCount-1
Dim t As String
C.Position=b
t=C.GetString("TIPO")
lst.AddCustomItem(b+1,CreateItem(50,b+1,t),50dip)
Next
Container.AddPageAt(Pan(5),"Avversità",5)
Dim sc As ScrollView
sc.Initialize(500)
Pan(6).AddView(sc,0,0,100%x,100%y)
sc.Visible=True
sc.BringToFront
sc.Color=Colors.Yellow
lstTratt.Initialize(Me, sc, "sc_CheckedChange", "", "", 1dip)
lstTratt.ExtensionColor=Colors.black
lstTratt.BackgroundColor=Colors.Transparent
lstTratt.DividerColor=Colors.ARGB(255,255,0,0)
C=Main.SQL.ExecQuery("SELECT TIPO FROM TIPO_TRATTAMENTI ORDER BY TIPO")
For b=0 To C.RowCount-1
Dim t As String
C.Position=b
t=C.GetString("TIPO")
lstTratt.AddCustomItem(b+1,CreateItem(50,b+1,t),50dip)
Next
Pan(6).Color=Colors.Transparent
Container.AddPageAt(Pan(6),"Trattamenti",6)
Pager.Initialize(Container, "Pager")
Pager.Color=Colors.Black
Tabs.Initialize(Pager)
Tabs.LineHeight = 5dip
Tabs.LineColorCenter = Colors.ARGB(255,218,165,32)
Tabs.TextColor = Colors.Gray
Tabs.TextColorCenter = Colors.White
Activity.AddView(Tabs, 0dip, btnSave.Height, 100%x, 100%y-btnSave.Height)
lst.ResizePanel()
Activity.AddView(Pager, 0dip, btnSave.Height+40, 100%x, 100%y-btnSave.Height)
Inspecting all this stuff using the debugger everything gets loaded correctly inside the ClsCheckList.
Where am I wrong?
Thank you in advance!
Raffaele
Last edited: