Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-20-2010, 11:46 AM   #1 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 812
johnqh is on a distinguished road
Default How to iPad start app in landscape?

I have an iPhone app which I want to make an universal app.

On iPhone, it should always start in portrait.
On iPad, it can start in portrait or landscape.

How do I do that? I already have the code in viewcontroller to allow landscape on iPad. However, it starts in portrait, then rotate to landscape.
johnqh is offline   Reply With Quote
Old 08-20-2010, 03:01 PM   #2 (permalink)
Awesome
 
Esko2300's Avatar
 
Join Date: Jun 2009
Location: New York, N.Y.
Posts: 389
Esko2300 is on a distinguished road
Default

Quote:
Originally Posted by johnqh View Post
I have an iPhone app which I want to make an universal app.

On iPhone, it should always start in portrait.
On iPad, it can start in portrait or landscape.

How do I do that? I already have the code in viewcontroller to allow landscape on iPad. However, it starts in portrait, then rotate to landscape.
OK im not 100% sure but i believe you have to go into your info.plist files in your resources folder, click on one of the rows and then click on the plus sign to add a row, now you can type in <b>Initial interface orientation</b> then just specify if its landscape or potrait

Last edited by Esko2300; 08-20-2010 at 03:04 PM.
Esko2300 is offline   Reply With Quote
Old 08-20-2010, 05:31 PM   #3 (permalink)
Nerd.
 
Join Date: Jun 2010
Location: In a house
Posts: 458
BillyGiggles is on a distinguished road
Default

Find in your code

Code:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
Chnage it to

Code:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
Or
Code:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
For landscape left
BillyGiggles is offline   Reply With Quote
Reply

Bookmarks

Tags
ipad, landscape, orientation, portrait, universal

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 340
5 members and 335 guests
freewind, HemiMG, lendo, Newbie123, PlutoPrime
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,894
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:54 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0