Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mbpc2d.user

macrumors newbie
Original poster
Apr 4, 2008
20
0
I have it so I can rotate my program, but how can I set the default orientation?
 
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.
 
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/l...ENERAL-START_MY_APPLICATION_IN_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!! :rolleyes:
 
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
 
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)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)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
 

Attachments

  • leftOrientation.png
    leftOrientation.png
    48.2 KB · Views: 173
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
 
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
 
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
 
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
 
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.
 
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.