在我的 application.xml 中,我可以设置初始窗口的位置。然而,这是从屏幕左上角开始以像素为单位设置的。
那么我该如何居中呢?
最佳答案
试试这个(这是 JavaScript):
var bounds = null;
var screen = air.Screen.mainScreen.visibleBounds;
bounds = new air.Rectangle(
(screen.width - WINDOW_WIDTH ) / 2,
(screen.height - WINDOW_HEIGHT) / 2,
WINDOW_WIDTH,
WINDOW_HEIGHT
);
htmlLoader.stage.nativeWindow.bounds = bounds;
关于javascript - Adobe Air App 在中心启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1966958/