Whilst this is true, what you can do, is have 2 ListViews (unless you want to go down the ScrollView route) and then flip between the two, making it appear as if its' changing colourYou cannot change the color of the selected item.
If you want it you should use a ScrollView.
There are many ScrollView examples.
Best regards.
Sub Globals
Dim ListView1 As ListView
Dim bmp As Bitmap
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim i As Int
bmp.Initialize(File.DirAssets, "Rose.png")
ListView1.Initialize("ListView1")
Activity.AddView(ListView1, 0, 0, 100%x, 100%y)
ListView1.TwoLinesAndBitmap.ItemHeight = 70dip
ListView1.TwoLinesAndBitmap.Label.Left = 0
ListView1.TwoLinesAndBitmap.Label.Top = 0
ListView1.TwoLinesAndBitmap.Label.Width = ListView1.Width - 70dip
ListView1.TwoLinesAndBitmap.Label.Height = 40dip
ListView1.TwoLinesAndBitmap.Label.Gravity = Gravity.CENTER_VERTICAL
ListView1.TwoLinesAndBitmap.Label.TextSize = 20
ListView1.TwoLinesAndBitmap.SecondLabel.Left = 0
ListView1.TwoLinesAndBitmap.SecondLabel.Top = 40dip
ListView1.TwoLinesAndBitmap.SecondLabel.Width = ListView1.Width - 70dip
ListView1.TwoLinesAndBitmap.SecondLabel.Height = 30dip
ListView1.TwoLinesAndBitmap.SecondLabel.Gravity = Gravity.CENTER_VERTICAL
ListView1.TwoLinesAndBitmap.SecondLabel.TextSize = 16
ListView1.TwoLinesAndBitmap.ImageView.Left = ListView1.TwoLinesAndBitmap.Label.Width + 5dip
ListView1.TwoLinesAndBitmap.ImageView.Top = 5dip
ListView1.TwoLinesAndBitmap.ImageView.Width = 60dip
ListView1.TwoLinesAndBitmap.ImageView.Height = 60dip
ListView1.TwoLinesAndBitmap.ImageView.Gravity = Gravity.FILL
For i = 0 To 20
ListView1.AddTwoLinesAndBitmap("Line 1" & i, "Line 2" & i, bmp)
Next
End Sub
Dim pnl as panel
pnl = sv.Panel.GetView(3) 'The first position is 0, so for the fourth item, the position is 3
Dim lbl as label
lbl = pnl.GetView(0) 'I suppose that your label is in first position in the item panel
lbl.Text = ... your new text
I have tried this and also just passed "" as the second label, but the result is the same--the text for the first label is still pushed to the top of the entry. Any chance an update will provide a "SingleLineAndBitmap" option that will vertically center a single line of text on the bitmap?Tips
If you want a single line item with a bitmap (and do not need two lines and a bitmap), you can set the visible property of the second label to false.
You can move the 1st label down/centered or make it the full item height and set the Gravity (Of the First Label) how you want it aligned.I have tried this and also just passed "" as the second label, but the result is the same--the text for the first label is still pushed to the top of the entry. Any chance an update will provide a "SingleLineAndBitmap" option that will vertically center a single line of text on the bitmap?
Sub Globals
Dim ListView1 As ListView
Dim bmp As Bitmap
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim i As Int
bmp.Initialize(File.DirAssets, "Rose.png")
ListView1.Initialize("ListView1")
Activity.AddView(ListView1, 0, 0, 100%x, 100%y)
ListView1.TwoLinesAndBitmap.ItemHeight = 70dip
ListView1.TwoLinesAndBitmap.Label.Left = 0
ListView1.TwoLinesAndBitmap.Label.Top = 0
ListView1.TwoLinesAndBitmap.Label.Width = ListView1.Width - 70dip
ListView1.TwoLinesAndBitmap.Label.Height = 70dip
ListView1.TwoLinesAndBitmap.Label.Gravity = Gravity.CENTER_VERTICAL
ListView1.TwoLinesAndBitmap.Label.TextSize = 20
ListView1.TwoLinesAndBitmap.ImageView.Left = ListView1.TwoLinesAndBitmap.Label.Width + 5dip
ListView1.TwoLinesAndBitmap.ImageView.Top = 5dip
ListView1.TwoLinesAndBitmap.ImageView.Width = 60dip
ListView1.TwoLinesAndBitmap.ImageView.Height = 60dip
ListView1.TwoLinesAndBitmap.ImageView.Gravity = Gravity.FILL
For i = 0 To 20
ListView1.AddTwoLinesAndBitmap("Line 1" & i, "", bmp)
Next
End Sub