I have a CLV where I want to change the label layout after the layout file has been loaded into the item.
The simple way of achieving this doesn't work - I'm sure there's a good reason.
B4X:
ub Add_DetailedCLVItem(pnlItemBase As B4XView, uItem As udtItem)
' If pnlItemBase.NumberOfViews = 0 Then
pnlItemBase.LoadLayout("ItemDetails")
lbl1.Text = uItem.text
lbl2.Text = $"Information on the ${lbl2LorR}"$
lbl3.text = $"Data on the ${lbl3LorR}"$
lbl2.SetLayoutAnimated(0, lbl2Position,0,150,30)
lbl3.SetLayoutAnimated(0, lbl3Position,0,150,30)
' lbl3.RemoveViewFromParent
' End If
End Sub
The setlayoutanimated methods have no effect, although interestingly the RemoveViewFromParent works when uncommented.
I'm attaching a project with the complete code
Screenshot Left shows how it looks on startup and should look after clicking the "Move Left" button
Screenshot Right show how it looks after clicking the "Move Right" button - but the label that says "Information on the Right" should BE on the right, and the label that says "Data on the Left" should BE on the left.
This can't be done until the detail to be entered into each item is known, so I don't see that presetting it in the layout file is an option.
I am able to set the total item height when I add the item, and I am doing that.