Create solid separator

强颜欢笑 提交于 2019-12-23 09:59:26

问题


I have looked around quite a bit and cannot find the solution.

I am adding a separator in SceneBuilder. This is easy. Now I want this separator to be a solid line.

This I am having issues with. I have tried :

-fx-border-style: solid;
-fx-border-width: 1px;

But this doesn't seem to work or any combination of this.


回答1:


i think you missed line part in below css

.separator *.line { 
-fx-border-style: solid;
-fx-border-width: 1px;

}

with boarder width 5px

Tip : use CSS Analayzer to know css class/selector for particular part of node, you can find css analyzer in scenebuilder 1.1 view -> Show css Analyzer or ctrl+6 shortcut in windows.




回答2:


Its the solution of your problem, which was my problem too:

.separator *.line {
    -fx-border-style: solid;
    -fx-border-width: 0 0 1 0; /* its make really one-pixel-border */
    -fx-border-color: red;
}



回答3:


None of the other answers worked for me. I finally gave it a negative padding as I noticed the divider forms a rectangle and it worked like a charm.

.separator *.line{
    -fx-border-style: solid;
    -fx-padding: 0 -50 0 0;
}


来源:https://stackoverflow.com/questions/14347282/create-solid-separator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!