Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 6, 2008, 02:23 PM   #1
mbpc2d.user
macrumors newbie
 
Join Date: Apr 2008
iPhone orientation

I have it so I can rotate my program, but how can I set the default orientation?
mbpc2d.user is offline   0 Reply With Quote
Old Apr 6, 2008, 02:52 PM   #2
iphoneGuy
macrumors member
 
Join Date: Oct 2007
Location: [[NSLocation alloc] initWithCity: Chicago]
Quote:
Originally Posted by mbpc2d.user View Post
I have it so I can rotate my program, but how can I set the default orientation?
You can not set the default orientation.
iphoneGuy is offline   0 Reply With Quote
Old Apr 6, 2008, 04:15 PM   #3
mbpc2d.user
Thread Starter
macrumors newbie
 
Join Date: Apr 2008
hmm, that presents a problem lol. thanks dude
mbpc2d.user is offline   0 Reply With Quote
Old Apr 6, 2008, 04:42 PM   #4
iphoneGuy
macrumors member
 
Join Date: Oct 2007
Location: [[NSLocation alloc] initWithCity: Chicago]
Quote:
Originally Posted by mbpc2d.user View Post
hmm, that presents a problem lol. thanks dude
You could however get the current orientation and if it is not the way you like it alert the user to roatet the device.. But your UI should just make them realize that they need the device rotated such as the Kalimba sample.
iphoneGuy is offline   0 Reply With Quote
Old Apr 6, 2008, 06:55 PM   #5
mbpc2d.user
Thread Starter
macrumors newbie
 
Join Date: Apr 2008
yeah, I thought about that. the kimbala and bubblelevel apps both maintain there portrait orientations and since nothing moves or rotates, it works. but i was hoping to be able to allow my app run in landscape mode and allow the user to choose landscapeleft or lanscaperight. but i guess i could just keep it portrait and force the user to hold it one way, and since thats how apples examples are, they shouldn't have a problem with that style.
mbpc2d.user is offline   0 Reply With Quote
Old Jul 25, 2008, 06:12 PM   #6
nmelo
macrumors newbie
 
Join Date: Jul 2008
Send a message via MSN to nmelo
well..In fact you can set the "default" orientation

well..in fact you can set the "default" orientation for the application...

Check it out:

http://developer.apple.com/iphone/li...LANDSCAPE_MODE

You need to edit your Info.plist file to add the UIInterfaceOrientation key with the appropriate value (UIInterfaceOrientationLandscapeRight or UIInterfaceOrientationLandscapeLeft).

but I guess what you are asking is how to have a view to be "landscape" when your application is set to portrait mode view? well...I'm trying to do the same thing...the youtube application behaves this way which is kinda curious.

If someone comes up with something please post!!
nmelo is offline   1 Reply With Quote
Old Sep 3, 2008, 06:11 PM   #7
ximxc2
macrumors newbie
 
Join Date: Sep 2008
UIDevice setOrientation

Actually you can change it with this statement

[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationPortrait];

The UIDevice's orientation property is read-only and the compilator marks a warning... but works fine ^_^.
Maybe there's a better way to do it, but I couldn't find another solution.

Regards,
GC
ximxc2 is offline   0 Reply With Quote
Old Jan 20, 2009, 01:34 AM   #8
deepak832
macrumors newbie
 
Join Date: Jun 2008
Problem in orientation

Hi all,

I am implementing orientation in my application view. But when my device rotate to left or right with that my image is also rotates but that time a blank black view is display in 1/4 part of the screen, i don't know why.
I am just doing
- (BOOL)shouldAutorotateToInterfaceOrientationUIInterfaceOrientation)interfaceOrientation
{
return YES;
}


I am attaching the screen which i am getting after rotation, in that the corner black frame is displaying after rotation, and i don't know why ? and that frame cut my half image.


Please help me how can i solve this problem.


Thanks in Advance,
Deepak
www.umundo.com
Attached Thumbnails
Click image for larger version

Name:	leftOrientation.png
Views:	45
Size:	48.2 KB
ID:	153800  
deepak832 is offline   0 Reply With Quote
Old Jan 21, 2009, 06:15 AM   #9
nmelo
macrumors newbie
 
Join Date: Jul 2008
Send a message via MSN to nmelo
deepak, try resizing your image_view to fit the landscape mode. The OS merely handles the rotation but does not resize your screen or places your UI controls in the correct place, you need to handle that manually.
hope it helps!

Nelson
nmelo is offline   0 Reply With Quote
Old Jan 22, 2009, 04:58 AM   #10
deepak832
macrumors newbie
 
Join Date: Jun 2008
Problem in Orientation and Zooming

Acutely i used UIScrollView and added the image in that like [scrollView addSubview:imageView]; it works fine, but i used zooming and orientation both.. my orientation code is working fine with the help of your reply. But when i done zoom with scale 3-4 and if then used left or right orientation then my image get out from my scrollview.

I don't know why..



Thanks,
Deepak
www.umundo.com

Last edited by deepak832; Jan 28, 2009 at 05:16 AM.
deepak832 is offline   0 Reply With Quote
Old Jan 22, 2009, 09:56 AM   #11
PhoneyDeveloper
macrumors 68020
 
PhoneyDeveloper's Avatar
 
Join Date: Sep 2008
@deepak, You need to set the autoresizeMask for your views so they're resized when the device rotates.
PhoneyDeveloper is offline   0 Reply With Quote
Old Jan 23, 2009, 07:12 AM   #12
deepak832
macrumors newbie
 
Join Date: Jun 2008
Problem is same

Hi,
I used all that in my code like
scrollView.autoresizingMask =
( UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
scrollView.maximumZoomScale = 5;
scrollView.minimumZoomScale = 1;
scrollView.clipsToBounds = YES;
scrollView.autoresizesSubviews = YES;

But problem is same..


Thanks
deepak832 is offline   0 Reply With Quote
Old Jan 23, 2009, 08:55 AM   #13
PhoneyDeveloper
macrumors 68020
 
PhoneyDeveloper's Avatar
 
Join Date: Sep 2008
What about the autoresizingMask for the imageView?
PhoneyDeveloper is offline   0 Reply With Quote
Old Feb 3, 2009, 01:32 AM   #14
Ashli
macrumors newbie
 
Join Date: Feb 2009
Orientation problem

Hello,
In my iPhone application i used zooming and orientation both. But at the time of orientation i am giving back button only when in UIDeviceOrientationPortrait mode, not with other mode.
My application get failed because of above region.




Ashli
Ashli is offline   0 Reply With Quote
Old Mar 10, 2011, 02:42 PM   #15
todizara
macrumors newbie
 
Join Date: Dec 2010
hello!

I have an application with three views, the first two buttons to go in the other two. I would like one of the views will be displayed in landscape.

I tried [[UIDevice currentDevice] setOrientation: UIInterfaceOrientationLandscapeRight], but it not work.

I set its direction in interface builder but he is still in portrait.

If you have an idea, I know because I am confused here.
todizara is offline   0 Reply With Quote
Old Mar 10, 2011, 03:05 PM   #16
nickculbertson
macrumors regular
 
Join Date: Nov 2010
Location: Nashville, TN
Quote:
Originally Posted by todizara View Post
hello!

I have an application with three views, the first two buttons to go in the other two. I would like one of the views will be displayed in landscape.

I tried [[UIDevice currentDevice] setOrientation: UIInterfaceOrientationLandscapeRight], but it not work.

I set its direction in interface builder but he is still in portrait.

If you have an idea, I know because I am confused here.
try

Code:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
Nick
__________________
My App Blog --->
nickculbertson is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
AdWhirl - moving view to centre screen on rotation gwelmarten iPhone/iPad Programming 0 Oct 19, 2011 11:09 AM
iPhone 5, iPhone 4S and iPhone 4 photo comparison. CardboardGiant iPhone 4 Oct 3, 2011 09:20 PM
Grab New Verizon iPhone? Or wait till iPhone 5? ivdig iPhone 24 Jan 11, 2011 02:46 PM
iPhone orientation.... sujithkrishnan Mac Programming 0 Jun 10, 2008 04:48 AM


All times are GMT -5. The time now is 02:37 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC