iPad上的UIInterfaceRental

iPad上的UIInterfaceRental,ipad,Ipad,我有一个应用程序,是一个游戏,它看起来或工作不正常的景观 现在我的代码是: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Overriden to allow any orientation. return (interfaceOrientation == UIInterfaceOrientationPortrait); } 这使得它只能在纵向(底

我有一个应用程序,是一个游戏,它看起来或工作不正常的景观

现在我的代码是:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Overriden to allow any orientation.
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

这使得它只能在纵向(底部的主页按钮)上运行,我希望它同时在纵向(底部或顶部的主页按钮)上运行,所以苹果接受它

我试过:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Overriden to allow any orientation.
    return (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
但它不起作用。。。
有人能给我代码让它在两种纵向模式下运行吗。

您只能返回一次,所以第二个return语句永远不会被计算。将其设置为布尔值或:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Overriden to allow any orientation.
    return (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) || (interfaceOrientation == UIInterfaceOrientationPortrait);
}
也有用于纵向和横向的宏,但这应该可以正常工作