Thanks Erel, it worked! But...
I have supressed the
Private dd As DDD and
dd.Initialize.
I have replaced some items as you said, becoming:
B4XPages.MainPage.dd.(......)
And kept the
DDD.CollectViewsData in the second layout designer's script.
I'm not sure if I have to leave the
xui.RegisterDesignerClass(B4XPages.MainPage.dd) but with or without it, the result seems to be the same.
Now the items are being added to CLV.
When a new item is added, i am having difficult to control its width:
- the green panel is the parent of the CLV (named LV2, magenta)
- orange is the panel from layout I used when adding an item
Each added item is created with small width. Some code I used:
' My CLV (LVapa) proprieties:'
LVapa.AsView.Width = 100%x - 40dip
LVapa.sv.Width = LVapa.AsView.Width
'Adding new item:'
LVapa.Add(CreateListItem("ABC", LVapa.AsView.Width, 100dip), "DEF")
'If I replace LVapa.AsView.Width by 20dip or 500dip, the result is the same '
'At Private Sub CreateListItem I tried to add some code about the layout panel (PanelAPAs), with no effect:'
B4XPages.MainPage.dd.GetViewByName(p, "PanelAPAs").Width = 100%x
'At item layout designer's script:'
AutoScaleAll
DDD.CollectViewsData
PanelAPAs.Width = 100%x
'No effect changing this value'
When I have many items and touch the magenta area, I can swipe de inside scrollview from CLV without problem.
The item click sub returns when I click just in the orange area.
And as I told in the first post, I have another CLV, with basically the same code, working well.
The small part we can see, with a house icon, show us the layout of the second CLV is right (because it's differente from the first CLV).
What am I doing wrong?