开发者

Can we ignore screen orientation or do we have to handle it?

开发者 https://www.devze.com 2023-03-14 18:00 出处:网络
Although I know how to handle screen orientation in an iPhone application. Is there possibly a way we can ignore 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消