JFXPopup - CSS rules not working for list items
I'm having problems using CSS to change colors in a JFXPopup. I tried several combinations, but... no luck. I'm using jfoenix v1.7.0. Can anyone tell me how i change the items and the selected item in the JFXPopup list?
My code is as follows:
.jfx-popup-container { -fx-background-color: yellowgreen; }
.jfx-popup-container .jfx-list-view { -fx-background-color: aquamarine; -fx-pref-width: 70px; -fx-background-insets: 25 0 25 0; }
.jfx-popup-container .jfx-list-view .jfx-list-cell { -fx-background-color: orange; }
.jfx-popup-container .jfx-list-view .placeholder .label { -fx-text-fill: navy; }
.jfx-popup-container .jfx-list-view .jfx-list-cell .label:selected { -fx-text-fill: white; }
Many thanks.
Hello, if the list view items are of type String, then you can use the following css:
.jfx-popup-container
{
-fx-background-color: yellowgreen;
}
.jfx-popup-container .jfx-list-view
{
-fx-background-color: transparent;
-fx-pref-width: 70px;
-fx-background-insets: 25 0 25 0;
}
.jfx-popup-container .jfx-list-view .jfx-list-cell
{
-fx-background-color: orange;
}
.jfx-popup-container .jfx-list-view .jfx-list-cell .text
{
-fx-fill: navy;
}
.jfx-popup-container .jfx-list-view .jfx-list-cell:selected .text
{
-fx-fill: white;
}
.jfx-popup-container .jfx-list-view .jfx-list-cell:selected
{
-fx-background-color: red;
}
as JFXListCell has be updated to be consistent with Java ListCell.
Regards,