Hi All
I have read everything I can on the forums including this link https://www.b4x.com/android/forum/t...matically-set-label-height.77849/#post-493054
but i am unable to find anything that works. I have actually tried to increase the size (Height) of the panel manually but it does not work either.
I have a clv with an image and 2 labels. They all display fine when anything is added but I cannot get the labels to increase their size automatically. Sometimes the label will have 2 lines of text and sometimes 4.
The code has been taken from the example and is
I have tried .clvMessage.AddTextItem but that just puts a text label on the panel without the other views.
Can anyone point me in the direction of a working example to fix this. Also I do not understand the logic behind adding the panel (p) and then removing it. I would have thought that all the views on the panel would be removed too. I am obviously missing something here.
Appreciate any help with this
I have read everything I can on the forums including this link https://www.b4x.com/android/forum/t...matically-set-label-height.77849/#post-493054
but i am unable to find anything that works. I have actually tried to increase the size (Height) of the panel manually but it does not work either.
I have a clv with an image and 2 labels. They all display fine when anything is added but I cannot get the labels to increase their size automatically. Sometimes the label will have 2 lines of text and sometimes 4.
The code has been taken from the example and is
B4X:
Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel
Dim p As Panel
p.Initialize("")
Activity.AddView(p, 0, 0, Width, Height)
p.LoadLayout("CellItem")
p.RemoveView
Label1.Text = Text
lblMessage.Text=msgTitle & CRLF & msgBody
' clvMessage.AddTextItem(msgTitle & CRLF & msgBody,"")
If NextRecord Mod 2 = 0 Then
lblMessage.Color=Colors.Blue
Label1.Color=Colors.Cyan
Else
lblMessage.Color=Colors.White
Label1.Color=Colors.White
End If
' If NextRecord=23 Then Log(lblMessage & msgBody)
iv1.SetBackgroundImage(bmpName)
Return p
End Sub
I have tried .clvMessage.AddTextItem but that just puts a text label on the panel without the other views.
Can anyone point me in the direction of a working example to fix this. Also I do not understand the logic behind adding the panel (p) and then removing it. I would have thought that all the views on the panel would be removed too. I am obviously missing something here.
Appreciate any help with this