我想在不更改iphone应用程序中的设备方向的情况下更改应用程序的方向。 我想以编程方式将我的视图从portraid模式更改为景观模式。如何更改应用程序的方向而不更改iphone应用程序中的设备方向
还想知道这是否会被苹果商店接受?
感谢
现在,我得到来自其他即是解决如下
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
,当你在那个时候一个警告出现添加此行,为消除此警告只需添加上你实现娄代码文件..
@interface UIDevice (MyPrivateNameThatAppleWouldNeverUseGoesHere)
- (void) setOrientation:(UIInterfaceOrientation)orientation;
@end
,之后在波纹管的方法,如果需要的只是写这个代码..
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
但现在想知道这是否被苹果应用程序商店接受?
感谢
没有改变与您的鳕鱼e,在UI中没有变化。UI应该从肖像变为景观 – uttam
只需放在你的viewWillAppear:方法的这一行的上方。[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight]; –
我希望在点击按钮时更改方向。而且我正在对应用程序进行回退。 – uttam