Android Question nested list : Panel size is unknown. Layout may not be loaded correctly.

davidvidasoft

Member
Licensed User
i use a nested list with listview. in the example show two warnings.

Warnings:
- Class not found: anywheresoftware.b4a.samples.customlistview.customlistview, trying: b4a.example3.customlistview
- Panel size is unknown. Layout may not be loaded correctly.
Code:
B4X:
Sub CreateItem(clr As Int, title As String, size As Int) As B4XView
    Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, clv1.AsView.Width, ExpandedHeight)
    p.LoadLayout("Item")
    
    ListView1.SingleLineLayout.Label.Height = 50dip
    ExpandedHeight = (ListView1.SingleLineLayout.Label.Height * (size+1)) + 20dip
    listHeight.Add(ExpandedHeight)
    ListView1.SingleLineLayout.Label.TextColor = Colors.Blue
    p.SetLayoutAnimated(0, 0, 0, p.Width, CollapsedHeight)
    
    pnlExpanded.Height = ExpandedHeight
    ListView1.Height = ExpandedHeight
    lblTitle.Text = title
    pnlTitle.Color = clr
    pnlExpanded.Color = ShadeColor(clr)
    
    For i=0 To size - 1
        ListView1.AddSingleLine2($"Item ${title}-->${i+1}"$,$"id: ${title}-${i+1}"$)
    Next
    p.Tag = False 'collapsed
    Return p
End Sub
Example:
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Class not found: anywheresoftware.b4a.samples.customlistview.customlistview, trying: b4a.example3.customlistview
You can ignore this one. It means that the full class name in the layout file was not found. You can remove the existing CustomListView and add it again.

Panel size is unknown. Layout may not be loaded correctly.
This one is indeed a mistake. ExpandedHeight is 0 when the layout is loaded. This means that it will not be loaded properly.
 
Upvote 0
Top