Ios 方法[UIDevice setOrientation:]-是否仍被拒绝?
我听说使用Ios 方法[UIDevice setOrientation:]-是否仍被拒绝?,ios,uiinterfaceorientation,Ios,Uiinterfaceorientation,我听说使用[UIDevice setOrientation:可能是Appstore中拒绝应用程序的原因。有关于它的任何证明信息吗?这是正确的-当使用此私有方法时,您的应用程序将被拒绝。我们做到了,我们被拒绝了(我们找到了解决办法)。当前(iOS 5)的定义是: @property (nonatomic, readonly) UIDeviceOrientation orientation 因此,即使有setter(setOrientation:或.orientation=),它也将是私有API,
[UIDevice setOrientation:
可能是Appstore中拒绝应用程序的原因。有关于它的任何证明信息吗?这是正确的-当使用此私有方法时,您的应用程序将被拒绝。我们做到了,我们被拒绝了(我们找到了解决办法)。当前(iOS 5)的定义是:
@property (nonatomic, readonly) UIDeviceOrientation orientation
因此,即使有setter(
setOrientation:
或.orientation=
),它也将是私有API,因为官方文档称它不存在。使用私有API会被拒绝。如果一个方法没有文档记录,就不要使用它。使用未记录的方法将导致拒绝。这就像检查苹果的文档一样简单
在这种情况下,文件说明:
@property (nonatomic, readonly) UIDeviceOrientation orientation
该方法可以为您提供有关设备物理方向的信息,任何编码都不会改变该物理方向。它的设置取决于陀螺仪/加速计。如果你告诉设备它的方向是什么,那就没有意义了 如果要更改接口方向,则应查看UIViewController回调,该回调允许您定义:
interfaceOrientation property
– shouldAutorotateToInterfaceOrientation:
+ attemptRotationToDeviceOrientation
– rotatingHeaderView
– rotatingFooterView
– willRotateToInterfaceOrientation:duration:
– willAnimateRotationToInterfaceOrientation:duration:
– didRotateFromInterfaceOrientation:
使用以下命令:
- (UIInterfaceOrientation)首选交互方向进行演示{ 返回UIInterfaceOrientationPortrait; }
(BOOL)应该自动旋转指针FaceOrientation:(UIInterfaceOrientation)interfaceOrientation
,它很容易理解和使用。我的问题是如何使导航堆栈中的一些视图在其他视图固定时旋转。某些控制器只是阻止其他控制器的旋转,而不考虑其设置。:)也许,我应该提出另一个问题并在那里讨论。