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 06-29-2011, 06:23 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2011
Posts: 44
kamy is on a distinguished road
Default Portrait mode iPhone but both modes for iPad

Hi Experts,

I have started developing universal app which support both iPhone and iPad and i need to solve this issue.

If the device is iPhone, i need to support ONLY Portrait mode.
If the device is an iPad, i need to support BOTH Portrait and Landscape modes.

Is this even possible?
If yes, how do we go bout this?

All examples, show how to support Portrait and Landscape modes for both devices.

Any answers would be appreciated.
kamy is offline   Reply With Quote
Old 06-29-2011, 06:49 AM   #2 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

The settings are separate in project settings. And if you are looking for the shouldAutorotateToInterfaceOrientation, you generally have separate view controllers for iPad and iPhone so just set what you want in each. If you use the same, you can check deviceIdiom and return different values based on that.
baja_yu is offline   Reply With Quote
Old 06-29-2011, 07:23 AM   #3 (permalink)
Registered Member
 
Join Date: Jun 2011
Posts: 44
kamy is on a distinguished road
Default

Quote:
Originally Posted by baja_yu View Post
The settings are separate in project settings. And if you are looking for the shouldAutorotateToInterfaceOrientation, you generally have separate view controllers for iPad and iPhone so just set what you want in each. If you use the same, you can check deviceIdiom and return different values based on that.

Thank You Sir. I never knew it was so simple
To others

If we use one controller, we do this
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientationUIIn terfaceOrientation)interfaceOrientation
{
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
// Return YES for supported orientations
return YES;
}
else
{
return NO;
}
}
kamy is offline   Reply With Quote
Reply

Bookmarks

Tags
landscape, portrait, universal app

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: 336
7 members and 329 guests
chemistry, iOS.Lover, lendo, leostc, Leslie80, pbart, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

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