It is easy to change orientation of the iPad/iPhone simulators by following: hardware->rotate left or right. But, how can I change it on iDevice (iPad device or iPhone device?)
please can somebody help me?
should I add some code?
It is easy to change orientation of the iPad/iPhone simulators by following: hardware->rotate left or right. But, how can I change it on iDevice (iPad device or iPhone device?)
please can somebody help me?
should I add some code?
转到您的摘要选项卡,向下滚动以转到“iPad 部署信息”。取消选择“支持的界面方向”中的所有四个选项。然后再次选择,但先选择人像,然后再选择。
同样在您期望处于纵向模式的视图中,只需添加
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskAll;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation
{
return (orientation == UIInterfaceOrientationMaskAll);
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationPortrait;
}
希望这可以帮助。
转到支持文件中的 .plist 文件
在那里你会看到支持的界面方向添加下面的键
Item 0 String Portrait (top home button)
Item 1 String Portrait (bottom home button)
Item 2 String Landscape (left home button)
Item 3 String Landscape (right home button)
对 UIApplication 的调用setStatusBarOrientation
将伪造旋转
将Initial interface orientation
键/值添加到您的$appName-info.plist
文件