B4J Question labels in TableView loosing color after heavy runtime usage

a n g l o

Active Member
Licensed User
Longtime User
hi, the post subject is the problem.
i apologize in advance for being unable to supply the code or example.
trying to re-create the problem in a small project example fails. it does not occur.
the above table view is the only view (designer) on a normal form.
it is activated by the main app window (not as a child).
now, the form shows in windows taskbar, and trigered up and down from there (after 1st activation).
all the cells in the table contain labels added in runtime.
the labels has difference colors according to content.
everything is fine except that after heavy usage up and down during work - the labels suddenly loose their colors
and becomes default black.
closing the form (X) and reactivating returns the colors.

without the example - can anyone think of a reason for that ?
Thank you
 

stevel05

Expert
Licensed User
Longtime User
It would be useful if you post the example code, even if it doesn't fail, so we can see how you are updating the views. It may provide a clue as to why it happens.
 
Upvote 0

a n g l o

Active Member
Licensed User
Longtime User
OK, for others who may need : i found the problem in the loop that populating the tableview, in the following piece of code :
B4X:
Dim lbl13 As Label
lbl13.Initialize("")
lbl13.Font=fx.CreateFont("Ariel",fontSize1,True,False)
If wc.rollsMade>0 Then
    lbl13.TextColor=fx.Colors.Red
    lbl13.Text=wc.rollsMade
Else
    lbl13.Text=""   
End If
what made all the tableview' labels lose text colors was hitting the lbl13.Text="" case.
the correction that fixed that was to move the font settings into the if-case it really needed :
B4X:
Dim lbl13 As Label
lbl13.Initialize("")
If wc.rollsMade>0 Then
    lbl13.Font=fx.CreateFont("Ariel",fontSize1,True,False)
    lbl13.TextColor=fx.Colors.Red
    lbl13.Text=wc.rollsMade
Else
    lbl13.Text=""   
End If

Thanks anyway
 
Upvote 0
Top