Listener for screen rotation

Skoðað 77 sinnum
Fara í fyrstu ólesnu skilaboð

ipan...@gmail.com

ólesið,
6. maí 2015, 03:44:416.5.2015
til javafx...@googlegroups.com
Hi,

is there any listener that detect screen rotation on javaFX that would works for ioS and android. My apps have didn't resize screen if it's rotate.

I want to add clausel to listener like:

if( screen.isRotate() ){
// resize or render new screen
}

Thanks for your help,

Ivan

Ivan Maulana

ólesið,
13. maí 2015, 07:44:4113.5.2015
til javafx...@googlegroups.com,ipan...@gmail.com

Hi,

for someone who interesting on the answer:

scene = stage.getScene();
scene.widthProperty().addListener((observable, oldValue, newValue) -> {
System.out.println("Width has changed from " + oldValue + " to " + newValue
);
});

Johan Vos

ólesið,
21. maí 2015, 14:13:5221.5.2015
til javafx...@googlegroups.com,ipan...@gmail.com
That should work, but your app should also auto-rotate when the screen is rotated. 
Svara öllum
Svara höfundi
Senda áfram
0 ný skilaboð