Can we ignore screen orientation or do we have to handle it?
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 makin开发者_如何学运维g few changes. Is there some way in iPhone too?
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.
you can stop screen orientation by returning interfaceOrientation == UIInterfaceOrientationPortrait
on shouldAutoRotateToInterfaceOrientation
Edited to be technically correct.
精彩评论