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 01-14-2010, 10:47 AM   #1 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 4
ChrisB123 is on a distinguished road
Question Landscape rotation problems

Hi all,
like many others im having problems implementing forced landscape rotation.
My app allows a user to select/take a photo. If the photo was taken in landscape orientation then I
force the user to view it in landscape orientation.

I have finally come up with a hack that allows me to do this.
The hack involves removing the navigation controller from the window and adding the landscape view
controller directly to the window which allows the landscape view to override the shouldAutorotateToInterfaceOrientation.

In order to allow the landscape view controller to be navigated to by the navigation controller
I push a "placeholder" view controller onto the navigation controllers stack and the moment it
displays, I remove the navigation controller from the window and add the landscape view
directly to the window.

The landscape controller has its own navigation controller in order to maintain consistency with
the rest of the app. When back is pressed I simply remove the Landscape controller from the window
and then re-add the original navigation controller to the window and pop the placeholder view from
it to prevent the landscape view from being loaded again.

This all works but looks horrible!
What happens is this: After the user has selected a landscape photo, the top status bar rotates to
landscape orientation straight away, but unfortunately the menu bar and the rest of the photo album screen stay in portrait orientation.

After a few seconds my landscape view controller loads and displays the picture as it should.
But for these few seconds after selecting a photo the screen looks foul with mismatched status bar orientation.

I have overidden the drawRect method of the view that draws the landscape image and it seems that it is the call to [image drawInRect] that is causing the problem because it takes so long!
If i remove this call, then the screen switches instantly to my landscape view controller with no horrible unprofessional looking lag, but obviously the picture doesnt get drawn which isnt much use

Please see the screenshot that i have attached as it probably explains the problem much better than I can with words!

In the photo you can see that the status bar has prematurely rotated itself to landscape whilst the rest of the screen stays put in portrait.
*EDIT (HAVE ADDED A ZIP FILE INCLUDING THE PHOTO BECAUSE PHOTO DOESNT SEEM TO WORK!)

If anyone could offer a solution to this problem I would be extremely grateful

Thanks in advance,
Chris.
Attached Images
File Type: jpg a.jpg (13.0 KB, 1 views)
Attached Files
File Type: zip photo.jpg.zip (64.7 KB, 10 views)

Last edited by ChrisB123; 01-14-2010 at 10:59 AM.
ChrisB123 is offline   Reply With Quote
Old 01-14-2010, 10:57 AM   #2 (permalink)
Registered Member
 
Join Date: Jan 2010
Posts: 4
ChrisB123 is on a distinguished road
Default

For some reason this screenshot I have uploaded doesnt seem to work! Have included in a zip file as well.

Last edited by ChrisB123; 01-14-2010 at 10:59 AM.
ChrisB123 is offline   Reply With Quote
Reply

Bookmarks

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: 334
9 members and 325 guests
2Apps1Day, akacaj, Domele, michelle, NSString, SLIC, soohyun, Techgirl-52, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,650
Threads: 94,114
Posts: 402,886
Top Poster: BrianSlick (7,990)
Welcome to our newest member, soohyun
Powered by vBadvanced CMPS v3.1.0

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