Skip to main content
Participating Frequently
February 27, 2012
Question

Different settings for iPhone and iPad

  • February 27, 2012
  • 1 reply
  • 544 views

Hello

I am working on an iOS application targeting both iPhone and iPad.

The design and interface of my application is different for iPhone and iPad. Because of this I want to set different values for <aspectRatio> and <autoOrients> in the descriptor file.

Actually what I want is this:

iPhone:

<aspectRatio>portrait</aspectRatio>

<autoOrients>false</autoOrients>

iPad:

<autoOrients>true</autoOrients>

I don't want to specify a value for aspectRatio.

The problem is that I don't see a way to specify different values based on the device.

Thanks in advance.

This topic has been closed for replies.

1 reply

Participating Frequently
February 27, 2012

You can't have different settings like that in the descriptor. What you could do however is set the aspectRatio to portrait and allow autoOrients (true). For iPhone you could listen to when the screen orientation changes and prevent the change from happening. This would be the equivalent to having autoOrients set to false in the descriptor. Eg:

stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING, orientationChange);

function orientationChange(e:StageOrientationEvent):void {

      e.preventDefault();

}

It won't matter what aspectRatio is set in your descriptor in the case of the iPad, because the screen orientation will automatically change depending on how the device is being held by the user.

Hope that helps,

-Tim