【问题标题】:Resizing objects when entering full screen mode in Flex在 Flex 中进入全屏模式时调整对象大小
【发布时间】:2010-12-07 14:23:14
【问题描述】:

考虑以下 Flex 代码:

private function fullScreenHandler(evt:FullScreenEvent):void {
  if (evt.fullScreen) {
    viewstack.selectedIndex = 2;
    objectInViewStack2.width = [code to detect width when in full screen mode];
    objectInViewStack2.height = [code to detect height when in full screen mode];
  } else {
     viewstack.selectedIndex = 1;
  }
}

我有一个带有两个包含画布的视图堆栈。在正常模式下使用画布 1,在全屏模式下使用画布 2。

要正确调整objectInViewStack2 的大小,我需要知道在全屏模式下屏幕的大小。

解决给定问题的正确方法是什么?

【问题讨论】:

    标签: apache-flex flash actionscript-3


    【解决方案1】:

    使用Capabilities 类。

    具体来说,我建议您查看screenResolutionYscreenResolutionX

    但是,您也可以考虑在 updateDisplayList() 中调整子元素的大小,这将始终为您提供容器的高度和宽度,我怀疑这对于调整大小的目的比屏幕分辨率更重要。

    【讨论】:

      猜你喜欢
      • 2014-11-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多