Don't use ListView.
Use xCustomListView - it is more powerful, easier to work with and cross platform.
Use xCustomListView - it is more powerful, easier to work with and cross platform.
Last edited:
If you want to alter the text of the views you could try to replace the Labels by EditText views. I haven't tried it yet but it should work.
Best regards.
Sub Globals
Dim ListView1 As ListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
ListView1.Initialize("ListView1")
For i = 1 To 300
ListView1.AddSingleLine("Item #" & i)
Next
Activity.AddView(ListView1, 0, 0, 100%x, 100%y)
Dim Bitmap1 As Bitmap
Bitmap1.Initialize(File.DirAssets, "button.gif")
For i = 1 To 300
ListView1.AddSingleLine("Item #" & i)
ListView1.AddTwoLines("Item #" & i, "This is the second line.")
ListView1.AddTwoLinesAndBitmap("Item #" & i, "This is the second line.", Bitmap1)
Next
End Sub
Sub ListView1_ItemClick (Position As Int, Value As Object)
Activity.Title = Value
End Sub
See HttpUtils for that.How can i load a image directly from a url link?
No, you could use a ScrollView.Is it possbile to change the text color (or font) of an individual item on a listview?
Sub SetHighScores
Dim PlayerName As String
Dim PlayerScore As String
Dim I As Int
lstHighScores.Initialize("lstHighScores")
'lstHighScores.Color = Colors.Transparent
'lstHighScores.Clear
If File.Exists(File.DirInternal, "HighScores.txt") = False Then
Dim TW As TextWriter
PlayerScore = "75,000"
PlayerName = "G_HOSA_PHAT"
For I = 0 To 9
TW.Initialize(File.OpenOutput(File.DirInternal, "HighScores.txt", False))
TW.WriteLine(PlayerScore)
TW.WriteLine(PlayerName)
lstHighScores.AddTwoLines(PlayerScore, PlayerName)
Next
TW.Close
Else
Dim TR As TextReader
TR.Initialize(File.OpenInput(File.DirInternal, "HighScores.txt"))
For I = 0 To 9
PlayerScore = TR.ReadLine
PlayerName = TR.ReadLine
lstHighScores.AddTwoLines(PlayerScore, PlayerName)
Next
TR.Close
End If
End Sub
Sub SetHighScores
Dim PlayerName As String
Dim PlayerScore As String
Dim ScoreTemp As Long
Dim I As Int
If File.Exists(File.DirInternal, "HighScores.txt") = True Then File.Delete(File.DirInternal, "HighScores.txt")
If File.Exists(File.DirInternal, "HighScores.txt") = False Then
Dim PlayerRank As String
Dim TW As TextWriter
PlayerScore = "75,000"
PlayerName = "G_HOSA_PHAT"
TW.Initialize(File.OpenOutput(File.DirInternal, "HighScores.txt", False))
For I = 1 To 10
Select Case I
Case 1
PlayerRank = "1ST PLACE"
Case 2
PlayerRank = "2ND PLACE"
Case 3
PlayerRank = "3RD PLACE"
Case 4
PlayerRank = "4TH PLACE"
Case 5
PlayerRank = "5TH PLACE"
Case 6
PlayerRank = "6TH PLACE"
Case 7
PlayerRank = "7TH PLACE"
Case 8
PlayerRank = "8TH PLACE"
Case 9
PlayerRank = "9TH PLACE"
Case 10
PlayerRank = "10TH PLACE"
End Select
TW.WriteLine(PlayerRank & " - " & PlayerName)
TW.WriteLine(PlayerScore)
lstHighScores.AddTwoLines2(PlayerRank & " - " & PlayerName, PlayerScore, I)
Next
TW.Close
Else
Dim TR As TextReader
TR.Initialize(File.OpenInput(File.DirInternal, "HighScores.txt"))
For I = 1 To 10
PlayerScore = TR.ReadLine
PlayerName = TR.ReadLine
lstHighScores.AddTwoLines2(PlayerScore, PlayerName, I)
Next
TR.Close
End If
End Sub
For I = 0 To 9
TW.Initialize(File.OpenOutput(File.DirInternal, "HighScores.txt", False))
TW.WriteLine(PlayerScore)
TW.WriteLine(PlayerName)
lstHighScores.AddTwoLines(PlayerScore, PlayerName)
Next
Dim List1 As List
List1.Initialize
For I = 0 To 9
List1.Add(PlayerScore)
List1.Add(PlayerName)
lstHighScores.AddTwoLines(PlayerScore, PlayerName)
Next
File.WriteList(List1, File.DirInternal, "HighScores.txt")
Could you post your project as a zip file.
It would be much easier to help you because we could test it in the same conditions as you to see what happens.
Best regards.
Please don't delete your posts. This makes the whole thread broken.