Android Question Warning: Panel size is unknown. Layout may not be loaded correctly (B4A 5.8)

asales

Expert
Licensed User
Longtime User
I get this message in the logs:
B4X:
Panel size is unknown. Layout may not be loaded correctly.
when I fill the customlistview in B4A 5.8 Beta 1

In previous versions of B4A I don't get this message.

The same message is raised when I load layouts into AHViewPager library to create sliding panels.

What is the problem and how to fix it?

In attached there is my code using customlistview example.

This code is:
B4X:
Sub Globals
    Dim clv1 As CustomListView
    Private TablePanel As Panel
    Private lbTitle As Label
    Private lbDate As Label
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("1")
    For i = 1 To 10
       
        Dim p As Panel
        p.Initialize("panel")
        p.LoadLayout("listpanel")
           
        lbTitle.Text = i
        lbDate.Text = DateTime.Date(DateTime.Now)
           
        clv1.Add(p, TablePanel.Height, i)       
    Next
End Sub

It shows 10 messages in log with warning: "Panel size is unknown.".
 

Attachments

  • warningpanels1.zip
    10.3 KB · Views: 358

sorex

Expert
Licensed User
Longtime User
try adding it to the activity/panel first with a certain width and height.

B4X:
p.Initialize("")
activity.addview(p,0,0,100%x,100%y)
p.LoadLayout("listpanel")
 
Upvote 0

asales

Expert
Licensed User
Longtime User
try adding it to the activity/panel first with a certain width and height.

B4X:
p.Initialize("")
activity.addview(p,0,0,100%x,100%y)
p.LoadLayout("listpanel")
Don't work.
Now I get an error and not a warning.
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
you didn't give tablepanel a height either by adding it to a parent first.

Edit: no wait, it's probably in that layout file. (I never use layouts)
 
Upvote 0

asales

Expert
Licensed User
Longtime User
Edit: no wait, it's probably in that layout file. (I never use layouts)
Yes. I think the the warning is because I use loadlayout.
I want to know why this message (in the new 5.8 version of B4A) and how to fix it and still use the loadlayout (I don't want to create the layout in code).
 
Upvote 0
Top