Hi!
I use the MeasureMultilineTextHeight function by Alexander Stolte to dynamically adjust the height of CLV items.
This works, but adjusting the height of labels within the CLV items has no effect.
Does anyone have an idea?
I use the MeasureMultilineTextHeight function by Alexander Stolte to dynamically adjust the height of CLV items.
This works, but adjusting the height of labels within the CLV items has no effect.
B4X:
Sub BuildCLV
For i = 0 To comments.Size - 1
Dim k As Map = comments.Get( i )
CommentsCLV.Add( CreateListItem( k ), k )
Next
End Sub
Sub CreateListItem( k As Map ) As Panel
Dim p As B4XView = xui.CreatePanel( "" )
p.SetLayoutAnimated( 0, 0, 0, CommentsCLV.AsView.Width, 50dip )
p.LoadLayout( "comment" )
LabelComment.Text = k.Get( "text" )
Dim nHeight As Double = MeasureMultilineTextHeight( LabelComment )
p.Height = nHeight + 4dip ' works
LabelComment.Height = nHeight ' this has no effect (neither does SetLayoutAnimated)
Return p
End Sub