B4J Question How can change the color of a specific row in tableview?

invocker

Active Member
I set this code but not work

B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("1")' create with scene builder layouts
    tblprocess.SetColumns(Array As String("icon","Label","Name","Code" ))
    For i=0 To 3
        tblprocess.SetColumnWidth(i,160)
    Next
    listprocess.Initialize
    lbl1.Initialize("")
    lbl2.Initialize("")
    lbl3.Initialize("")
'    lbl1.Initialize("")
'    lbl2.Initialize("")
'    lbl3.Initialize("")
    For i =0 To 20
        Dim row(4) As Object
        lbl1.Initialize("")
        lbl2.Initialize("")
        lbl3.Initialize("")
        imgpr.Initialize("")
        imgpr.SetSize(60,60)
        imgpr.SetImage(fx.LoadImage(File.DirAssets, "icon.png"))
        listprocess.Put("icon",imgpr)
        listprocess.Put("Label","Label" & i)
        listprocess.Put("Name","Name"&i)
        listprocess.Put("Code","Code" & i)
        lbl1.Text =listprocess.Get("Label")
        Log(lbl1.Text)
        lbl2.Text = listprocess.Get("Name")
        lbl3.Text=listprocess.Get("Code")
        row(0)=listprocess.Get("icon")'icon
        If lbl1.Text="Label6" Then
            lbl1.TextColor =  (fx.Colors.Green)
            Log("yes")
        End If
        row(1)=lbl1.Text 'Label
        row(2)=lbl2.Text ' Name
        row(3)=lbl3.Text 'Code
        tblprocess.Items.Add(row)
    Next
End Sub
 
Last edited:
Top