Android Question [B4XTable] Change text colour of a cell by value

vecino

Well-Known Member
Licensed User
Longtime User
Hi, I want to show a different colour of a cell as shown in this image (Interesting Number), how can I do it?
I know there was a thread explaining this, but I can't find it.
Thank you.

SS-2019-02-07_15.33.03.png
 
Solution
When are you told to write in a different colour when the value is greater than 1?
It works for me. Look at my code my man
B4X:
Private  formatter As B4XFormatter
B4X:
CreateCustomFormat(B4XTable1.GetColumn("Student_Num"))
    formatter.GetDefaultFormat.TextColor = xui.Color_Black
B4X:
Private Sub CreateCustomFormat (c As B4XTableColumn)
    formatter.Initialize
    c.Formatter = formatter
    Dim Positive As B4XFormatData = c.Formatter.NewFormatData
    Positive.TextColor = xui.Color_Red
'    Positive.TextColor = B4XTable1.TextColor
    Positive.FormatFont = xui.CreateDefaultFont(22)
    c.Formatter.AddFormatData(Positive, 114.01, c.Formatter.MAX_VALUE, True) 'change your 114.01 to 1.01
End Sub

1643917629534.png
Top