Universal Application - iPhone: Portrait. iPad: Landscape

Im looking to create a Universal iOS application.

When running on an iPhone it should support only the Portrait orientation.

When running on an iPad it should only support the Landscape orientation.

 

 

Is this kind of configuration possible with Corona?

I would have said no initially, but you should try it. Take a look here:

https://coronalabs.com/blog/2013/09/10/modernizing-the-config-lua/

Unfortunately, the original article link is broken, but I’m sure if you dig a bit there is some gold to be found.

I have a sense the answer is, “No.”

I say this, because build.settings is the file you specify orientation rules in.

I’m pretty sure this file is only used in the build (as the name would imply), BUT if it is actually examined at run time, then you might be able to do this IF you can also detect the device you’re on.  

Again, I think the answer is, “No.” and I hope to hear more from others on this topic.

I agree with @roaminggamer - I think the config.lua is the only file which can contain actual code whereas the build.settings file defines the orientation settings.

What you would have to do is fix the orientation, detect the device the app is running on and perform the rotation and size/layout operations yourself. The hard bit is what you’ll be doing anyway, so rotating your main display group when it’s an iPad isn’t really such a tall order.

I’m not sure I’ve heard of anyone successfully building a portrait phone and landscape tablet app at the same time that didn’t detect the device and rotate the canvas manually.

Rob

@Rob, is it possible to create “if” statements on build.settings like we can on config.lua? if it is, it should be possible, if not, can be added?

You cannot put executable code in build.settings.

The best thing to do is to create a feature request for this at http://feedback.coronalabs.com and get it voted up.

Rob

I would have said no initially, but you should try it. Take a look here:

https://coronalabs.com/blog/2013/09/10/modernizing-the-config-lua/

Unfortunately, the original article link is broken, but I’m sure if you dig a bit there is some gold to be found.

I have a sense the answer is, “No.”

I say this, because build.settings is the file you specify orientation rules in.

I’m pretty sure this file is only used in the build (as the name would imply), BUT if it is actually examined at run time, then you might be able to do this IF you can also detect the device you’re on.  

Again, I think the answer is, “No.” and I hope to hear more from others on this topic.

I agree with @roaminggamer - I think the config.lua is the only file which can contain actual code whereas the build.settings file defines the orientation settings.

What you would have to do is fix the orientation, detect the device the app is running on and perform the rotation and size/layout operations yourself. The hard bit is what you’ll be doing anyway, so rotating your main display group when it’s an iPad isn’t really such a tall order.

I’m not sure I’ve heard of anyone successfully building a portrait phone and landscape tablet app at the same time that didn’t detect the device and rotate the canvas manually.

Rob

@Rob, is it possible to create “if” statements on build.settings like we can on config.lua? if it is, it should be possible, if not, can be added?

You cannot put executable code in build.settings.

The best thing to do is to create a feature request for this at http://feedback.coronalabs.com and get it voted up.

Rob