Feb 012011
 

I’m going to explain in a nice, easy way exactly how to set up your iPhone app project in the correct orientation.

This past week or so I’ve had more people than ever ask me about how to correctly setup their iPhone apps orientation – and that’s really saying something as it is probably the 3rd most common question I get already. (The first being “How did you learn Lua/Corona?” and the second some variation of “Why did you switch to Corona from GameSalad and should I do it too?”)

Because of that I wanted to quickly throw this post together; it’s not technically a tutorial, but it really doesn’t need to be. This is a basic, easy thing to do – once you know how. That isn’t an insult, like “Hey, this is easy, why don’t you get it?” – I actually had the same issues myself when I started out.

Side note: If the post has typos or the like please forgive me – it’s 2:38 AM at the time of writing and still it is around 95F after sitting at 104F for most of today. (We also got two blackouts each lasting several hours, in a 12 hour period – it hasn’t been pleasant.)

So, here’s the rundown;

Portrait Orientation

The iPhone (or whatever iDevice you’re currently working with) is held “normally” – it wont rotate if turned upside down, because that’s stupid ;)

Landscape Orientation

The iPhone is on it’s side and it will automatically rotate to be the right way up. Apple requires this.

I’m sure everyone knew these things already, but I like to take a really newbie friendly approach.

So, I have put together two zip folders – download whatever is right for you, or both for future projects.

Unzip them and put both build.settings and config.lua into your project folder, overwriting your preexisting ones.

*I am including both files as often when playing around trying to make things work, I’ve found people edit both. If you are using anything other than an iPod touch or iPhone you will simply want to change “480″ and “320″ to whatever is appropriate. (Also, I have prerendered icon set to true, meaning a gloss effect isn’t applied automatically. Change this to false if you like gloss.)

Download Portrait Files

Download Landscape Files

And that’s it!

I hope it will help a bunch of you who are still learning, I know it can be tricky at best and completely overwhelming at first when still just starting out!

Peach Pellen :)

PS – For those of you who don’t follow me on Twitter, I’d like to let those of you have donated this past week know that thanks to you I will be eating the long forgotten meal of lunch tomorrow and then having lasagna for dinner. I am GREATLY looking forward to it :D

Like this post? Subscribe to the monthly newsletter!

 

  7 Responses to “How To Make Your iPhone App Portrait Or Landscape”

  1. Thanks you for something which just works! – as it should be.

    IPete2

  2. Oh right, OK, put in all four orientations as supported; that should work :)

  3. What I’d like is if the device is vertical, then the top of the object/images are vertical (pointing up)…if I turn it to landscape, then I want the images to rotate and still be pointing up… :-) How’s that? is that more clear?

  4. Hey Tim,

    I’m heading out shortly so may not be able to get back to you for a bit, but do you mean you want it to rotate to whichever rotation it’s currently at, be that landscape or portrait?

    Let me know :)

    Peach

  5. Evening…or afternoon in your case! I’ve poked ’round, but I can’t seem to find how to have an app rotate automatically as the iOS device is turned…any pointers (so to speak)? I know I’ve just read it in the past couple of days, but I just can’t remember where. :-} Thanks!!

  6. Another gem! Thank you!

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.