Android Question Panel height determination after layout loading

ThePuiu

Active Member
Licensed User
Longtime User
I have a Custom ListView in which I add a panel. How do I programmatically determine what vertical dimension the panel occupies?
B4X:
CLVOf.Add(CreatePanel,0)

Sub CreatePanel() As B4XView
    
    Dim xui As XUI
    Dim p As B4XView = xui.CreatePanel("")
    p.LoadLayout("itemOfertareLayout")
    ............................................   
        
    p.SetLayoutAnimated(0,0,0,Activity.Width, XXXXXXXXXXXdip)
    Return p
End Sub

I did not find a universally valid method through the forum ...
Thank you!
 

ProjectGroup19

Active Member
Licensed User
B4X:
Sub CreateListItem( Width As Int, Height As Int) As B4XView
    Dim p As Panel
    p.Initialize("")
    p.SetLayout(0, 0, Width, Height)
    p.LoadLayout("customLayout") 'load custom layout
  
    Dim PnlHeight As Int = pnlAllCustom.Height+ 7dip ' set a new height by getting the height of a view in the customLayout
    p.SetLayout(0,0,Width,PnlHeight) 'set the height with the new height
    Return p

End Sub

This is how i do it.
 
Upvote 0
Top