Hi all,
I'm trying to find a way to set the SingleLineLayout.ItemHeight of a ListView according to the values of a List, but I have some problem.
Here's a sample code:
NewData is a List populated reading values from a sqlite db. First time ShowData is called the set of ItemHeight is correct, but then this first set is always used for every next call.
su.MeasureMultilineTextHeight(ll, NewData.Get(posizione)) always return the correct value, but ListViewData.SingleLineLayout.ItemHeight is no more set.
Why? What I'm doing wrong?
I'm trying to find a way to set the SingleLineLayout.ItemHeight of a ListView according to the values of a List, but I have some problem.
Here's a sample code:
B4X:
Sub ShowData(position as Int)
Dim su As StringUtils
Dim ll As Label
Dim i As Int
ListViewData.Clear
ListViewData.AddSingleLine(NewData.Get(position))
ll = ListViewData.SingleLineLayout.Label
ll.TextSize = ListViewData.SingleLineLayout.Label.TextSize
ll.Width = ListViewData.Width
ListViewData.SingleLineLayout.ItemHeight = su.MeasureMultilineTextHeight(ll, NewData.Get(posizione))
End Sub
NewData is a List populated reading values from a sqlite db. First time ShowData is called the set of ItemHeight is correct, but then this first set is always used for every next call.
su.MeasureMultilineTextHeight(ll, NewData.Get(posizione)) always return the correct value, but ListViewData.SingleLineLayout.ItemHeight is no more set.
Why? What I'm doing wrong?