I'm display a SQLite into a ListView but the display is adding a extra linefeed whenever it wants to. I'm using AddTwoLines or AddTwoLinesAndBitmap, both are doing this.
All I did was scroll the list up and down, it's always different. There are over 1200 items in the SQL but sometimes it will do it will only 20 or so also.
I've try with and without a bitmap.
It only seems to do this in portrait mode, Landscape is correct.
My Current code, with bitmap, 100x100 transparent, one with star,
Any Ideas
Little Eddie
All I did was scroll the list up and down, it's always different. There are over 1200 items in the SQL but sometimes it will do it will only 20 or so also.
I've try with and without a bitmap.
It only seems to do this in portrait mode, Landscape is correct.
My Current code, with bitmap, 100x100 transparent, one with star,
B4X:
Sub UpdateSongs
lvSongs.Clear
Dim Cursor1 As Cursor
Dim Bitmap1 As Bitmap
Dim BitmapEmpty As Bitmap
Bitmap1.Initialize(File.DirAssets, "Star2.png")
BitmapEmpty.Initialize(File.DirAssets, "Empty100x100.png")
'This moves the Bitmap to the Right side of the screen
lvSongs.TwoLinesAndBitmap.ImageView.Left = lvSongs.Width - (Bitmap1.Width / 1.5)
lvSongs.TwoLinesAndBitmap.Label.Left = 0
lvSongs.TwoLinesAndBitmap.SecondLabel.Left = 0
'lvSongs.TwoLinesAndBitmap.Label.Width = lvSongs.Width - Bitmap1.Width
'lvSongs.TwoLinesAndBitmap.SecondLabel.Width = lvSongs.Width - Bitmap1.Width
If CurrentArtist <> "" Then
Cursor1 = main.SQL1.ExecQuery("SELECT DISTINCT * FROM main WHERE artist = " & QUOTE & CurrentArtist & QUOTE & " ORDER BY title;")
For i = 0 To Cursor1.RowCount - 1
Cursor1.Position = i
If Cursor1.GetInt("fav") = 0 Then
lvSongs.AddTwoLinesAndBitmap(Cursor1.GetString("title"), cursor1.GetString("artist"), BitmapEmpty)
Else
lvSongs.AddTwoLinesAndBitmap(Cursor1.GetString("title"), cursor1.GetString("artist"), Bitmap1)
End If
Next
Else
Cursor1 = main.SQL1.ExecQuery("SELECT * FROM main ORDER BY title;")
For i = 0 To Cursor1.RowCount - 1
Cursor1.Position = i
If Cursor1.GetInt("fav") = 0 Then
lvSongs.AddTwoLinesAndBitmap(Cursor1.GetString("title"), cursor1.GetString("artist"), BitmapEmpty)
Else
lvSongs.AddTwoLinesAndBitmap(Cursor1.GetString("title"), cursor1.GetString("artist"), Bitmap1)
End If
Next
End If
Cursor1.Close
End Sub
Any Ideas
Little Eddie