flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From OmPrakash Muppirala <bigosma...@gmail.com>
Subject Re: Mobile Width and Height
Date Mon, 17 Oct 2016 07:43:12 GMT
On Sun, Oct 16, 2016 at 9:43 PM, bilbosax <waspence41@comcast.net> wrote:

> I have written my first mobile AIR app.  On my iPad, the layout is a dismal
> failure.  It looks perfect in the simulator.
> I have the application set up to run in portrait mode with no
> auto-orientation.  It starts at 160 DPI and scales up.  When the
> application
> is complete, I get the width and height of the stage, and then use these
> numbers to calculate the layout of all of my buttons and column widths for
> my datagrid.  On the iPad, all of the buttons are spread way too far apart,
> several running off the screen.  The datagrid is all supposed to fit on the
> screen but four of the colums ran off the screen.

How are you getting the stage's width and height?  You should be using
stage.stageWidth and stage.stageHeight.

> It is almost as if it calculated the width of the screen in landscape mode
> instead of in portrait mode.  So I have two questions:
> 1) If you layout the application in portrait orientation, is the width of
> the stage the width in portrait orientation or landscape orientation?

It should start in portrait orientation, if you have set it in the
app-descriptor.xml file.

> 2) I am confused on how to lay everything out on mobile devices with
> varying
> screen densities. Is it better to get the app width and height and then set
> up distances and spacing in pixels, or to use percentages?

Best is to use percentages for layouts.  Also, create different skins for
different orientations and devices.  Use CSS media queries to specify the
appropriate skin.  [1]

> Thanks for any insight.  This was disappointing.

Sorry to hear that.  I am sure we can work this out :-)



> --
> View this message in context: http://apache-flex-users.
> 2333346.n4.nabble.com/Mobile-Width-and-Height-tp13813.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message