Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
Posts: 1,094
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C
Accepted Solution

ActionBar example not making sense

When I run this example:

 

https://developer.blackberry.com/air/apis/qnx/fuse/ui/actionbar/ActionBar.html#includeExamplesSummar...

 

on my DAC, the actionbar gets rendered well above the bottom of the screen.  Same goes for my Z10.

 

If I add traces to print out both the stage.stageWidth and stage.stageHeight, I get something like 500x375 for both devices, but Display.display.getDisplayWidth(0) and Display.display.getDisplayHeight(0) give the correct screen dimensions for both devices.  The value I get traced out for actionBar.height does not look right either (101 for the DAC).

 

Must be something obvious that I'm missing, but I'm tired and at a loss for why this simple API example seems to be misbehaving right out of the box.  Any help appreciated.

Developer
Posts: 1,094
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: ActionBar example not making sense

[ Edited ]

Screenshot posted (note that I added the share icon to the example code but it was rendering the same funky way right out of the API example code verbatim):


DAC_ActionBarExample.png

Developer
Posts: 1,094
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: ActionBar example not making sense

Ok I guess I'm getting closer to the answer but it doesn't make sense yet.

 

If I explicitly set the dimentions in my [SWF] directive, the ActionBar renders snapped to the bottom of the screen on both devices (I'm hardcoding it to the dimensions of each device before compiling & running ... but ... I thought that that was "doing it wrong") ... 

Developer
Posts: 1,094
Registered: ‎12-29-2010
My Device: PlayBook, Z10 LE, Dev Alpha C

Re: ActionBar example not making sense

[ Edited ]

Gaah.  I had just pasted in the example verbatim in a tired state, and forgot to put in the stage alignment and scaling init code:

 

			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;

 

Btw the 500x375 stage dimensions are the amxmlc default, which is why I got incorrect values:

 

http://cote.cc/blog/stagestagewidth-returning-incorrect-values-let-me-help