简体   繁体   中英

Adobe Air Mobile, with Flex and Actionscript 3: How do I change the height of the actionbar on all my views?

I am working with Flash Builder 4.5 using Adobe Air, Flex and Actionscript 3, to develop a mobile application that works with multiple views.

I want to change the height of my actionbar on all my views. I know that I can dynamically change it in actionscript 3 using:

navigator.actionBar.height = newHeight;

However, I would prefer to have the height in my style (.css) file, or if that's not possible, in the mxml code in every view, so that the actual height is reflected in the design-view. How can I accomplish this?

You could try exposing a new style such as:

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

In MXML you would do this in the Metadata tag, in ActionScript it would be before the class definition.

and then get the style in your component using the getStyle method:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM