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-17-2011, 08:27 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 31
appmaker3 is on a distinguished road
Exclamation Orientation

How can you choose to make the app in landscape mode? I change the Orientation of the view in the XIB, but it wont fix it..any help?????????
appmaker3 is offline   Reply With Quote
Old 08-17-2011, 09:15 PM   #2 (permalink)
***
 
huvan's Avatar
 
Join Date: May 2011
Location: Ho Chi Minh
Age: 25
Posts: 23
huvan is on a distinguished road
Default

Put it in the UIViewController that controls the view that you want to put in landscape mode as follow:
- (BOOL) shouldAutorotateToInterfaceOrientation:UIInterface Orientation)interfaceOrientation {
return (interfaceOrientation == UIDeviceOrientationLandscapeLeft);
}
__________________
Daniel
huvan is offline   Reply With Quote
Old 08-18-2011, 10:27 AM   #3 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 31
appmaker3 is on a distinguished road
Default

Where do i put it in the code...right after the implementation..in the .m the .h?
appmaker3 is offline   Reply With Quote
Old 08-18-2011, 10:39 AM   #4 (permalink)
***
 
huvan's Avatar
 
Join Date: May 2011
Location: Ho Chi Minh
Age: 25
Posts: 23
huvan is on a distinguished road
Default

Put it in .m file
__________________
Daniel
huvan is offline   Reply With Quote
Old 08-18-2011, 11:29 AM   #5 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 31
appmaker3 is on a distinguished road
Question

Unfortunately..that didn't work?


appmaker3 is offline   Reply With Quote
Old 08-18-2011, 12:02 PM   #6 (permalink)
***
 
huvan's Avatar
 
Join Date: May 2011
Location: Ho Chi Minh
Age: 25
Posts: 23
huvan is on a distinguished road
Default

I tested before posting. It's true.
Reference at http://stackoverflow.com/questions/4...portrait-views
__________________
Daniel

Last edited by huvan; 08-18-2011 at 12:07 PM.
huvan is offline   Reply With Quote
Old 08-18-2011, 12:20 PM   #7 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

Describe your application, are you using UITabBarController? or any other thing?
__________________

Last edited by dany_dev; 08-18-2011 at 12:45 PM.
dany_dev is offline   Reply With Quote
Old 08-18-2011, 08:07 PM   #8 (permalink)
***
 
huvan's Avatar
 
Join Date: May 2011
Location: Ho Chi Minh
Age: 25
Posts: 23
huvan is on a distinguished road
Default

HTML Code:
I used UINavigationController.

- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
	return (interfaceOrientation == UIDeviceOrientationLandscapeLeft);
}
__________________
Daniel
huvan is offline   Reply With Quote
Old 08-18-2011, 08:24 PM   #9 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 31
appmaker3 is on a distinguished road
Talking

All i am doing is making an app where you hit buttons..with pictures...and it is a view based application

appmaker3 is offline   Reply With Quote
Old 08-18-2011, 09:10 PM   #10 (permalink)
***
 
huvan's Avatar
 
Join Date: May 2011
Location: Ho Chi Minh
Age: 25
Posts: 23
huvan is on a distinguished road
Default

I have made a simple View-based Application with name Orientation. And add follow code into the file "OrientationViewController.m":

HTML Code:
- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
	return (interfaceOrientation == UIDeviceOrientationLandscapeLeft);
}
I attached the result.

You should try to do.
Good luck!
Attached Images
File Type: jpg Orientation.jpg (27.7 KB, 3 views)
__________________
Daniel
huvan is offline   Reply With Quote
Old 08-19-2011, 09:35 AM   #11 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 31
appmaker3 is on a distinguished road
Default

Thank You! I found a way to do it!

Last edited by appmaker3; 08-19-2011 at 09:57 AM.
appmaker3 is offline   Reply With Quote
Reply

Bookmarks

Tags
landscape, orientation, portrait

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: 389
14 members and 375 guests
7twenty7, chiataytuday, cristofercolmbos, dedeys78, fiftysixty, gmarro, iOS.Lover, jimmyon122, jonathandeknudt, pungs, raymng, stanny, tymex, UMAD
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,669
Threads: 94,121
Posts: 402,903
Top Poster: BrianSlick (7,990)
Welcome to our newest member, dedeys78
Powered by vBadvanced CMPS v3.1.0

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