根据Apple,我的应用程序必须能够以两种肖像模式运行。如何使用KellyAutorotateToInterfaceorientation完成此操作?

有帮助吗?

解决方案

无论接口方向是什么,只需返回是。这将允许系统自动座上倒置方向。

如果您不想支持景观取向,请返回:

return UIInterfaceOrientationIsPortrait(interfaceOrientation);

其他提示

此代码允许除景观以外的任何方向:

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation
{
    return (orientation != UIDeviceOrientationLandscapeLeft) &&
           (orientation != UIDeviceOrientationLandscapeRight);
}

提交的应用程序由于上述原因被拒绝。应用仅使用肖像(主页按钮向下)方向。

“应用程序不符合Apple IOS人类界面准则,按照App Store Review Guighine的要求。

具体而言,APP仅支持肖像方向的自下而上的变体,但不支持增值变体。

在支持两个方向的两个变体的同时,每个变体都具有唯一的启动图像,提供了最佳的用户体验,并且建议使用,但我们了解某些应用程序仅在肖像方向上必须运行。在这种情况下,支持您应用程序中的两个方向的两个变体,例如上下和向下的主页按钮。”

解决。 1)

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

2)打开信息。请添加一个新字符串 UILaunchImageFile & insert value as Default-Portrait.png

3)更改默认值为default-portrait.png&重复该文件以重命名default-portraitupsideDown.png(用180度旋转此文件)

这可以通过各自的启动图像来上下肖像。

如果需要,请确保在应用程序中的所有视图控制器中使用UIinterfaceorientationisportrait(界面方向)。跑步前也要干净。

用这个。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top