Sub createSmmryItem As Panel
Dim p As Panel
p.Initialize("")
p.LoadLayout("lySmmry")
p.SetLayout(0, 0, 100%x, pnlSmmry.Height)
p.Color = Colors.RGB(48,48,48)
Return p
End Sub
Sub Test
Private clv As CustomListView
clv.Clear
clv.Add(createSmmryItem,0)
End Sub
In layout "lySmmry", there are labels that Horizontal alignment set to right/center, but it didn't work, it always display with left alignment.
My xCustomListView version is 1.73 same as online version.
Same version of xCLV. Layout containing 2 Labels , Horizontal Alignment = RIGHT & Horizontal Alignment = CENTER_HORIZONTAL.
Displays as Expected.
B4X:
Sub createSmmryItem As Panel
Dim p As Panel
p.Initialize("")
p.LoadLayout("clvItems")
p.SetLayout(0, 0, 100%x, pnlSmmry.Height)
Label1.Text = "Test1"
Label2.Text = "Test2"
p.Color = Colors.RGB(48,48,48)
Return p
End Sub
I have these codes
In layout "lySmmry", there are labels that Horizontal alignment set to right/center, but it didn't work, it always display with left alignment.
My xCustomListView version is 1.73 same as online version.
Sub createSmmryItem As Panel
Dim p As Panel
p.Initialize("")
p.Width=clv.GetBase.Width 'set a width for Panel
p.LoadLayout("lySmmry")
p.SetLayout(0, 0, 100%x, pnlSmmry.Height)
p.Color = Colors.RGB(48,48,48)
Return p
End Sub
When I was trying to find the issue , the fact @incendio was seting the width (100%x) , seemed OK
I only realize now the different method of creating the panel ( not utilizing xui / b4xview), wich is probably why I have never encountered this issue.
B4X:
Sub CreateRow(text As String, width As Int, height As Int) As B4XView
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, width, height)
p.LoadLayout("clvItems")
Label1.Text = "This is Label 1 run #" & text
Return p
End Sub
Sub createSmmryItem As Panel
Dim p As Panel
p.Initialize("")
p.Width=clv.GetBase.Width 'set a width for Panel
p.LoadLayout("lySmmry")
p.SetLayout(0, 0, 100%x, pnlSmmry.Height)
p.Color = Colors.RGB(48,48,48)
Return p
End Sub