• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: iphone landscape problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iphone landscape problems


  • Subject: Re: iphone landscape problems
  • From: Robert Marini <email@hidden>
  • Date: Wed, 18 Feb 2009 14:25:39 -0500

In my applicationDidFinishLaunching I have:
[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated:NO];

Out of curiosity, what version of iPhone OS are you building for? If you're using 2.1 and later, it should just work. If not, you'll need to do something like this as well (I typed this in Mail so there may be blood...err...typos).


CGAffineTransform transform = self.view.transform
CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
CGRect bounds = CGRectMake(0, 0, statusBarFrame.size.height, statusBarFrame.origin.x);
CGPoint centerPoint = CGPointMake(bounds.size.height / 2.0, bounds.size.width / 2.0);
self.view.center = centerPoint;
transform = CGAffineTransformRotate (transform, (M_PI / 2.0));
self.view.transform = transform.


and then...

[window makeKeyAndVisible];

(otherwise the window will show and then rotate in a rather harsh fasion that the user would see)

2. when i create and show a UIAlertView it appears in portrait, even if I am holding my iphone in landscape and the views are in landscape. Is there no way to fix this?

If you've set your status bar orientation in applicationDidFinishLaunching and your view controllers are properly set up (overriding shouldAutorotateToInterfaceOrientation, etc) this should behave normally. If you could build for 2.2.1 and have verified that this is the case, please file a bug report. In the meantime one possible workaround is to rotate the view after it's been displayed in didPresentAlertView (though I've not heard of this since the 2.0 betas so I would double check my view controller related code).


-rob.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: iphone landscape problems
      • From: Memo Akten <email@hidden>
References: 
 >iphone landscape problems (From: Memo Akten <email@hidden>)

  • Prev by Date: Re: Moving oneself to /Applications (or ~/Applications)
  • Next by Date: Re: iphone landscape problems
  • Previous by thread: iphone landscape problems
  • Next by thread: Re: iphone landscape problems
  • Index(es):
    • Date
    • Thread