ジョーバンDukic:
私は、余分なスペースでボタン全体に合うように画像を作りたいです。私はこれを試してみましたが、その作業をしていません。
.toggle-button {
-fx-background-image: url("close.png");
-fx-background-repeat: stretch;
-fx-background-position: center center;
}
.toggle-button:selected{
-fx-background-image: url("contact.png");
}
これは私が得る結果です:
終了画像(赤い四角)は全体ボタンを埋めることを確認するには?
Zeusox:
あなたはそれ以外の場合は、バックグラウンドの大きさがゼロに設定され、バックグラウンド・サイズを設定する必要があります。次のことを試してみてください。
.toggle-button {
-fx-min-height: 132px;
-fx-min-width: 128px;
-fx-background-image: url("close.png");
-fx-background-size: 100% 100%;
-fx-background-repeat: no-repeat;
-fx-background-position: center 8px;
}