Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone device orientation

During inAppPurchase, the storeKit will ask the username and password

even though i set...

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];

It ask Username and password in Portrait Mode... In general How to solve this kind of issue.

UPDATED : But the InAppPurchase message on successful purchase is coming in landscape mode.

Thanks in advance,

like image 911
Chandan Shetty SP Avatar asked Nov 15 '22 11:11

Chandan Shetty SP


1 Answers

As of 3.2 you cannot change the orientation of a running application from code.

But you can start an application with a fixed orientation, although doing so this is not straightforward.

Try with this recipe:

  1. set your orientation to UISupportedInterfaceOrientations in the Info.plist file
  2. in your window define a 480x320 "base view" every other view will be added to
  3. in all view controllers set up the shouldAutorotateToInterfaceOrientation: method (to return the same value you defined in the plist, of course)
  4. in all view controllers set a background view with

    self.view.frame = CGRectMake(0, 0, 480, 320)

    in the viewDidLoad method that should do the trick.

References:

  • http://www.iphonedevsdk.com/forum/iphone-sdk-development/7366-interface-builder-landscape-design.html#post186977
  • http://www.iphonedevsdk.com/forum/iphone-sdk-development/7366-interface-builder-landscape-design.html#post190014
  • iPhone app in landscape mode, 2008 systems
like image 145
IlDan Avatar answered Dec 19 '22 11:12

IlDan