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 applicatio开发者_StackOverflow中文版n 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;
精彩评论