0

Although I know how to handle screen orientation in an iPhone application. Is there possibly a way we can ignore it?

Either by means of some code or may be setting it somewhere. For example in Android we can ignore screen orientation by making few changes. Is there some way in iPhone too?

halfer
  • 19,824
  • 17
  • 99
  • 186
Nitish
  • 13,845
  • 28
  • 135
  • 263

2 Answers2

2

If you don't implement or handle all the orientation then it should be oke:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

You app will only support portrait mode.

rckoenes
  • 69,092
  • 8
  • 134
  • 166
1

you can stop screen orientation by returning interfaceOrientation == UIInterfaceOrientationPortrait on shouldAutoRotateToInterfaceOrientation

Edited to be technically correct.

theiOSDude
  • 1,480
  • 2
  • 21
  • 36
  • Your answer is technically incorrect. @rckonenes has the right answer. You don't return orientation in shouldAutoRotateToInterfaceOrientation, you return a boolean. – ThomasW Jun 23 '11 at 11:50