Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.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 03-01-2009, 07:47 AM   #1 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 11
Question Moving from Portrait to Landscape

I have a multi-view app that is largely portrait based, but with one view that needs to be displayed in landscape only.

I have a main UIViewController subclass that handles the navigation and loading of the individual views.

In the controller for the landscape view I have added this to the viewDidLoad:

[self.view setCenter:CGPointMake(160.0f, 240.0f)];
[self.view setTransform:CGAffineTransformMakeRotation(3.14159 2f, 2.0f)];

This then causes the display to correctly rotate tand ensure that the landscape view is shown, however the status bar remains as though in portrait mode - i.e. to the left of the screen when holding the iPhone horizontally/landscape.

I'm hoping someone can advise me how to get the status bar to rotate into landscape mode when I rotate the view contents - or if there is a better way of achieving this altogether!

TIA
iGrump is offline   Reply With Quote
Old 03-01-2009, 08:52 AM   #2 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 11
Default

I found the answer!

I added:

[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeRight];

I then also needed to add:

self.view.bounds = CGRectMake(20.0f, -20.0f, 480.0f, 320.0f);

This moved the view back into the centre of the display (without it I had a black bar on the left of the screen where the status bar was displayed)

Hope this helps someone!
iGrump is offline   Reply With Quote
Reply

Bookmarks

Tags
landscape, rotation

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: 252
19 members and 233 guests
2WeeksToGo, @sandris, AdamL, ADY, BrianSlick, Dani77, diyora, F_Bryant, GHuebner, HDshot, headkaze, mer10, prchn4christ, Rudy, smithdale87, Thompson22, timle8n1, Touchmint, vigu360
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,748
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

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