Hello All,
I am aware that there is a similar thread here but the discussion there has not quite helped me.
Previously in B4A, I used to have create a CLV object, add it to the activity(100%x,100%y) and then iterate over a collection and add items to the CLV by creating a panel and loading that panel's layout from a layout file.
This approach no longer works correctly. Now I get the warning message:
'Panel size is unknown. Layout may not be loaded correctly.'
I have tried the workaround suggested on the above referenced thread but that doesn't help me. Even if that works, I want to know if this is an Android 5.x change that has caused this or is it specific to B4A?
Here is the code where I'm trying to load the CLV layout.
Then in Resume:
I am aware that there is a similar thread here but the discussion there has not quite helped me.
Previously in B4A, I used to have create a CLV object, add it to the activity(100%x,100%y) and then iterate over a collection and add items to the CLV by creating a panel and loading that panel's layout from a layout file.
This approach no longer works correctly. Now I get the warning message:
'Panel size is unknown. Layout may not be loaded correctly.'
I have tried the workaround suggested on the above referenced thread but that doesn't help me. Even if that works, I want to know if this is an Android 5.x change that has caused this or is it specific to B4A?
Here is the code where I'm trying to load the CLV layout.
B4X:
Sub Activity_Create(FirstTime As Boolean)
Dim dummyPanel As Panel
dummyPanel.Initialize("")
Activity.AddView(dummyPanel,0,0,100%x,100%y)
dummyPanel.Width = 100%x 'removing or leaving these two lines also don't make any difference
dummyPanel.Height = 100%y 'as above
dummyPanel.LoadLayout("MyCLVLayout")
' dummyPanel.RemoveView 'removing or leaving this doesn't make any difference
End Sub
Then in Resume:
B4X:
Dim l As List = GetAllObjectKeys
For Each key As String In l
Dim p As Panel = CreateItemPanel(key) 'this method loads the item layout
myCLV.Add(p, 124dip, key) 'myCLV was defined by right clicking in the designer
p.Height = 120dip
Next