【问题标题】:Adobe Air Mobile, with Flex and Actionscript 3: How do I change the height of the actionbar on all my views?Adobe Air Mobile,带有 Flex 和 Actionscript 3:如何更改所有视图上操作栏的高度?
【发布时间】:2011-07-29 12:59:05
【问题描述】:

我正在使用 Adob​​e Air、Flex 和 Actionscript 3 使用 Flash Builder 4.5,以开发一个支持多个视图的移动应用程序。

我想在所有视图上更改操作栏的高度。我知道我可以在 actionscript 3 中使用以下方法动态更改它:

navigator.actionBar.height = newHeight;

但是,我希望在我的样式 (.css) 文件中包含高度,或者如果不可能,在每个视图的 mxml 代码中包含高度,以便实际高度反映在设计视图中。我怎样才能做到这一点?

【问题讨论】:

    标签: actionscript-3 flex4.5 flash-builder4.5


    【解决方案1】:

    您可以尝试公开一种新样式,例如:

    [Style(name="actionBarHeight", inherit="no", type="Number")]
    

    在 MXML 中,您可以在 Metadata 标记中执行此操作,在 ActionScript 中,它将位于类定义之前。

    然后使用 getStyle 方法获取组件中的样式:

    var aHeight:Number = getStyle("actionBarHeight");
    navigator.actionBar.height = aHeight;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-24
      • 1970-01-01
      • 2013-02-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多