【发布时间】:2013-04-26 13:36:04
【问题描述】:
我想更改应用程序的方向而不更改 iphone 应用程序中的设备方向。 我想以编程方式将视图从纵向模式更改为横向模式。
还想知道苹果商店会接受吗?
谢谢
现在我从其他人那里得到了如下解决方案
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
当您添加这一行时,会出现一个警告,要删除此警告,只需在您的实现文件中添加以下代码。..
@interface UIDevice (MyPrivateNameThatAppleWouldNeverUseGoesHere)
- (void) setOrientation:(UIInterfaceOrientation)orientation;
@end
然后在下面的方法中,如果需要,只需编写此代码..
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
但现在想知道这是否被苹果应用商店接受?
谢谢
【问题讨论】:
标签: iphone objective-c ios