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 09-23-2011, 10:24 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 25
veterinarian2008 is on a distinguished road
Default Orientation Problem (HELP)

Hello everyone:

I am having some problems with the orientation on my app. If I have to app on landscape, and I switch to another view, things get off.

The way I have set the orientation is like this:



-(BOOL) shouldAutorotateToInterfaceOrientationUIInterfac eOrientation)interfaceOrientation {
* * // Return YES for supported orientations
* * if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
self.view = landscape;
}

else if (interfaceOrientation == UIInterfaceOrientationPortrait|| interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {

self.view = potrait;
}

* * return TRUE;
}




Each view has 2 views inside. One for landscape and the other for portrait. So I have 2 IBOutlets for each view so when I rotate, I call each view like*self.view = landscape or*self.view =*portrait.

Now. This is an example of the problem:

By the way, I am running landscape all the time. If I run portrait, I don't have those problems.

This is the main view of the app in landscape:

http://www.flickr.com/photos/6792279...in/photostream

Now when I press settings:

http://www.flickr.com/photos/6792279...in/photostream

It also happens when I select a theme: (Always in Landscape):

http://www.flickr.com/photos/6792279...in/photostream

This is the code when I select a theme to go back:

*CalcViewController_iPad *screen = [[CalcViewController_iPad alloc] initWithNibName:@"CalcViewiPad" bundle:nil];
[self presentModalViewController:screen animated:YES];
[screen release];


Is there any way I can fix this problem?

Thanks!

Last edited by veterinarian2008; 09-23-2011 at 10:27 AM.
veterinarian2008 is offline   Reply With Quote
Old 09-23-2011, 05:09 PM   #2 (permalink)
Just helping out.
 
Domele's Avatar
 
Join Date: Feb 2011
Posts: 2,565
Domele is on a distinguished road
Default

I assume you are presenting your settings screen using presentModalViewController. When you want to go back to the calculator screen, use
Code:
[self.parentViewController dismissModalViewControllerAnimated:YES];
You can accomplish the same thing by calling the dismiss on self but it's proper to have the view controller that present the modal vc to dismiss it as well.

About your orientation issue. Are you checking the orientation on loadView and setting the proper view?
__________________
If you are looking for a quality developer, I'm your man. Give me a PM if you are interested.

New app - See screenshots and details at www.globaclock.com.

If you want to thank me, click the link. Every click counts. If you want to do more, buy my app. A link is available on my website. Thanks.
Domele is offline   Reply With Quote
Reply

Bookmarks

Tags
orientation, uideviceorientation, view, xib

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: 391
15 members and 376 guests
13dario13, 7twenty7, eski, EvilElf, glenn_sayers, HemiMG, iOS.Lover, jarv, n00b, pbart, Pudding, sacha1996, Sami Gh, UMAD, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,672
Threads: 94,121
Posts: 402,905
Top Poster: BrianSlick (7,990)
Welcome to our newest member, yuncarl28
Powered by vBadvanced CMPS v3.1.0

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