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-24-2011, 11:40 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 42
frankmail007 is on a distinguished road
Default autorotation problem

I've created a testing program to explain my problem. My RootViewController will autorotation when device rotates by return YES in shouldAutorotateToInterfaceOrientation.

The RootViewController's view is a UITableView. There are 3 rows. The first row show "Portrait", the second row show "Landscape" and the third show "Autorotation". When I click the row, I'll push another DetailViewController by passing a int (0,1,2) in its initWithOrientation (init, without using IB) method.

Then inside DetailViewController's shouldAutorotateToInterfaceOrientation, I'll return according to the orientation value (0,1,2). For example, when orientation = 1, I'll only return YES for UIInterfaceOrientationPortrait or UIInterfaceOrientationPortraiUpsideDown.

This works fine inside the DetailViewController. But I have a problem. For example, the device's interface orientation is portrait, then when I click the row 1 which should be a Landscape orientation. But it's in portrait orientation. And problem exist too when I leave the DetailViewController. For example, when I enter into DetailViewController by click row 1 (the landscape orientation) and when I rotate to portrait, the interface is still in landscape which is correct because I only allow in landscape orientation. Then after I pop the DetailViewController, the interface is still in landscape which is not what I expected because I'm in RootViewController which should allow autorotation for all orientations.

Are there any solution to my problem? Thanks.
frankmail007 is offline   Reply With Quote
Reply

Bookmarks

Tags
autorotation, ios, iphone, viewcontroller

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: 396
15 members and 381 guests
7twenty7, chiataytuday, cristofercolmbos, dedeys78, fiftysixty, gmarro, iOS.Lover, jonathandeknudt, kilobytedump, Matrix23, raymng, stanny, tymex, UMAD, xerohuang
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:14 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0