Iphone 我们可以忽略屏幕方向还是必须处理它?

Iphone 我们可以忽略屏幕方向还是必须处理它?,iphone,Iphone,虽然我知道如何在iPhone应用程序中处理屏幕方向。我们有没有办法忽略它 要么通过一些代码,要么在某个地方设置它。例如,在安卓系统中,我们可以通过做一些更改来实现。iPhone中也有这样的方式吗 如果您没有执行或处理所有方向,则应: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orienta

虽然我知道如何在iPhone应用程序中处理屏幕方向。我们有没有办法忽略它


要么通过一些代码,要么在某个地方设置它。例如,在安卓系统中,我们可以通过做一些更改来实现。iPhone中也有这样的方式吗

如果您没有执行或处理所有方向,则应:

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

您的应用程序将只支持纵向模式。

如果您没有实现或处理所有方向,则应该:

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

您的应用程序将只支持纵向模式。

您可以通过在
shouldAutoRotateToInterfaceOrientation
上返回
interfaceOrientation==UIInterfaceOrientationPortrait
停止屏幕方向


编辑为技术正确。

您可以通过在
shouldAutoRotateToInterfaceOrientation
上返回
interfaceOrientation==UIInterfaceOrientationGrait
停止屏幕方向


编辑为技术正确。

您的答案在技术上不正确@rckonenes给出了正确的答案。您没有在shouldAutoRotateToInterfaceOrientation中返回方向,而是返回一个布尔值。您的答案在技术上是不正确的@rckonenes给出了正确的答案。在shouldAutoRotateToInterfaceOrientation中不返回方向,而是返回布尔值。