javafx常用控件css样式修改记录

2018-11-22  本文已影响200人  风少侠

状态信息

首先来了解一下控件各种常见状态下的表示方法:

ScrollBar

scroll_bar.png

.list-view .scroll-bar:vertical{
    -fx-background-color: #8646ee;
    -fx-background-radius: 10;
}

.list-view .scroll-bar:vertical .track{
    -fx-background-color: transparent;
}

.list-view .scroll-bar:vertical .thumb{
    -fx-background-color: #4c06c1;
}

.list-view .increment-button{
    -fx-background-color: transparent;
}

.list-view .increment-arrow{
    -fx-background-color: white;
}

.list-view .decrement-button{
    -fx-background-color: transparent;
}

.list-view .decrement-arrow{
    -fx-background-color: white;
}

效果图:


scroll_bar.png

TableView

/*表格头部背景*/
.table-view .column-header-background{
    -fx-background-image: url("/resource/img/competition_table_title_bg.png");
    -fx-background-size: stretch;
}

/*表格内容区域*/
.table-view .placeholder{
    -fx-background-color: transparent;
}

/*表格列*/
.table-column{
    -fx-background-color: transparent;
    -fx-alignment: center;
}

/*表格内容区域每行的样式*/
.table-row-cell{
    -fx-pref-height: 35;
    -fx-background-color: #befafa;
}
.table-row-cell:odd{
    -fx-background-color: #beecfb;
}
.table-row-cell .text{
    -fx-fill: #1c91c5;
    -fx-font-family: "FZCuYuan-M03S";
    -fx-font-size: 10pt;
}

效果图:


table_view.png
上一篇 下一篇

猜你喜欢

热点阅读