1

I have a app which i want to display in portrait mode. But I only want to show one view in both modes.

I have do this for iOS5 . But in iOS6,i can't able to do this.

I also tried many codes to solved it.

How can I solve this problem?

Rikesh
  • 26,156
  • 14
  • 79
  • 87
user1673099
  • 3,293
  • 7
  • 26
  • 57
  • The answer to the question here (http://stackoverflow.com/questions/14073057/turning-off-use-autolayout-causes-app-to-only-run-in-portrait-mode) may be relevant to your problem. – Jack Humphries Jan 28 '13 at 14:21
  • you can see this http://stackoverflow.com/questions/12812484/ios-6-orientation-issues/15698391#15698391 which relevant to your question. – Mani Mar 29 '13 at 08:25

1 Answers1

4

apple has changed orientation in ios 6 .

in short use following steps:

1) set supported orientations in Targets->Summary...

enter image description here

2)In iOS6.0 shouldAutorotateToInterfaceOrientation Method is deprecated.So,instead of this method we have to use shouldAutorotate Method.

- (BOOL)shouldAutorotate
 {

   return NO;

  }

3) in method supportedInterfaceOrientations we have to set which orientations we want like UIInterfaceOrientationMaskAll if we want all orientations

- (NSUInteger)supportedInterfaceOrientations
  {
return  (UIInterfaceOrientationMaskPortrait |     UIInterfaceOrientationMaskPortraitUpsideDown );

 }
Ravindra Bagale
  • 17,226
  • 9
  • 43
  • 70
  • Thanks for your Reply! But `supportedInterfaceOrientations` method is called only once & when i rotate i also take Landscape mode. – user1673099 Jan 29 '13 at 04:52