B4J Question Change Tableview Selected Row color at runtime

LDeeJay

Member
Hi All,

I have been searching the forum and the tutorials but couldn't find an answer yet. Is it possible to set the selected row color of a tableview (not B4XView) at runtime? The default is a blue one but I'd like to change it to red based on the content of one of the cell it's looking at. I know I can change the color with either the ExtraCSS field in the designer or by using a CSS file but they are both not accessible at runtime. Any suggestions?

Cheers,

Leon
 

LDeeJay

Member
You're right and the issue is solved because:
B4X:
tableview.Style = "-fx-selection-bar: red"
does work from code but ...
not when there's also a value in the CSSExtra in the designer. So the designer takes precedent over the code. I had to clear the value in the designer in order to make the code work.
 
Upvote 0
Top