JavaFX 8.0有這個bug,我不知道如何解決它。
示例:http://i.imgur.com/tavh6XA.png拖動後ScrollPane內容變得模糊
如果我拖動ScrollPane,它的內容會變得模糊,但如果將其拖回,內容將恢復其清晰度。如果我不修改coords,內容看起來相當不錯。
有沒有人解決這個問題?
示例代碼:
@Override
public void start(Stage stage) {
Pane pane = new Pane();
Scene scene = new Scene(pane, 500, 500);
pane.prefWidthProperty().bind(scene.widthProperty());
pane.prefHeightProperty().bind(scene.heightProperty());
ScrollPane scroll = new ScrollPane();
// Center ScrollPane
scroll.layoutXProperty().bind(pane.widthProperty().divide(2).subtract(scroll.widthProperty().divide(2)));
scroll.layoutYProperty().bind(pane.heightProperty().divide(2).subtract(scroll.heightProperty().divide(2)));
scroll.setPrefSize(200, 200);
ListView<String> list = new ListView<>();
scroll.setContent(list);
list.getItems().addAll("Resize the window", "and see how this list", "becomes blurry");
// Label indicates x, y coords of ScrolPane and their ratio.
TextField size = new TextField();
size.setPrefWidth(500);
size.textProperty().bind(
scroll.layoutXProperty()
.asString("x: %s; ").concat(
scroll.layoutYProperty()
.asString("y: %s; ")));
pane.getChildren().addAll(size, scroll);
stage.setScene(scene);
stage.show();
}
我有同樣的問題,除非沒有自定義佈局X/Y。看起來把ScrollPane放在swt.FXCanvas裏面會導致這個問題。試過sw/es2/d3d棱鏡引擎,但它們沒有區別。 – AqD 2014-10-06 08:07:52