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