A listview is not always displaying all lines using the code below. What's the root cause ? Thanks for ideas and answers.
Code extract:
Sub Globals
...
Private ListView1 As ListView
...
Sub Activity_Create(FirstTime As Boolean)
ScrollView1.Initialize(1000dip) ' a scrollview is placed beside the listview
...
ListView1.Initialize("ListView1")
Activity.AddView(ListView1, ScrollView1.Width + 10dip, 5dip, Activity.Width - ScrollView1.Width - 12dip, Activity.Height-
10dip)
...
Sub Calc_Click
Dim generalData() As String
Dim headline As String
Dim data() As String
...
ListView1.Clear
ListView1.SingleLineLayout.ItemHeight = 100dip
ListView1.SingleLineLayout.Label.TextSize = 20
ListView1.SingleLineLayout.Label.TextColor = Colors.Black
ListView1.SingleLineLayout.Label.Gravity = Gravity.LEFT
generalData = myLib.GetGeneralData()
For i = 1 To generalData.Length
ListView1.AddSingleLine(generalData(i-1)) 'these about 10 lines are usually displayed
Next
ListView1.TwoLinesLayout.ItemHeight = 100dip
ListView1.TwoLinesLayout.Label.TextSize = 20
ListView1.TwoLinesLayout.Label.TextColor = Colors.Black
ListView1.TwoLinesLayout.Label.Gravity = Gravity.LEFT
'sometimes none or only 15-20 first of these "records" are displayed
'data is checked and correct (strings and string arrays correct)
'it seems that once the ListView contains a number of rows it will not expand to more rows but Clear 'is used in code above
For j = 1 To 100
headline = myLib.getHeadline(j-1)
ListView1.AddTwoLinesAndBitmap("Item#" & j, headline, BitmapHeadLine)
data = myLib.getData(j-1)
For k = 1 To data.Length
ListView1.AddSingleLine(data(k-1))
Next
Next
End Sub
Code extract:
Sub Globals
...
Private ListView1 As ListView
...
Sub Activity_Create(FirstTime As Boolean)
ScrollView1.Initialize(1000dip) ' a scrollview is placed beside the listview
...
ListView1.Initialize("ListView1")
Activity.AddView(ListView1, ScrollView1.Width + 10dip, 5dip, Activity.Width - ScrollView1.Width - 12dip, Activity.Height-
10dip)
...
Sub Calc_Click
Dim generalData() As String
Dim headline As String
Dim data() As String
...
ListView1.Clear
ListView1.SingleLineLayout.ItemHeight = 100dip
ListView1.SingleLineLayout.Label.TextSize = 20
ListView1.SingleLineLayout.Label.TextColor = Colors.Black
ListView1.SingleLineLayout.Label.Gravity = Gravity.LEFT
generalData = myLib.GetGeneralData()
For i = 1 To generalData.Length
ListView1.AddSingleLine(generalData(i-1)) 'these about 10 lines are usually displayed
Next
ListView1.TwoLinesLayout.ItemHeight = 100dip
ListView1.TwoLinesLayout.Label.TextSize = 20
ListView1.TwoLinesLayout.Label.TextColor = Colors.Black
ListView1.TwoLinesLayout.Label.Gravity = Gravity.LEFT
'sometimes none or only 15-20 first of these "records" are displayed
'data is checked and correct (strings and string arrays correct)
'it seems that once the ListView contains a number of rows it will not expand to more rows but Clear 'is used in code above
For j = 1 To 100
headline = myLib.getHeadline(j-1)
ListView1.AddTwoLinesAndBitmap("Item#" & j, headline, BitmapHeadLine)
data = myLib.getData(j-1)
For k = 1 To data.Length
ListView1.AddSingleLine(data(k-1))
Next
Next
End Sub