如何将 AIR 窗口放置在第二台显示器上?
我想在第二台显示器上的 AIR/Flex 应用程序中打开一个窗口(如果可用)。不知道该怎么办。尝试过这个:
mySecondWindow.x = Capabilities.screenResolutionX;
但这只能获取第一个监视器的大小,如果我尝试分配更大的值,它会切换到默认的 100px 偏移。对此有正确的方法吗?我的本机屏幕在“预初始化”中最大化,然后我在“applicationComplete”上打开第二个窗口。
I'd like to open a window in my AIR/Flex application on a second monitor if it's available. Don't know how to go about it. Tried this:
mySecondWindow.x = Capabilities.screenResolutionX;
But this only gets the size of the first monitor and if I try to assign a greater value, it switches to default 100px offset. Is there a proper approach to this? My native screen is maximized in "preinitialize" and then I open the second window on "applicationComplete".
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用静态属性 Screens.screen 返回用户系统上的屏幕。
查看 Screen ASDoc 了解更多信息。
如果您需要有关如何使用它的示例,请查看此应用程序源代码
You can use the static property Screens.screen that returns the screens on a user system.
Have a look at the Screen ASDoc for more info.
If you need a sample of how to use it, have a look at this application source code
无论出于何种原因,直接将 X 和 Y 值分配给我的第二个窗口永远不会将其显示到第二个监视器上。最终起作用的是使用“move”方法来定位窗口。
For whatever reason, directly assigning X and Y values to my second window never got it onto the second monitor. What finally worked was to use the "move" method to position the window.