0
我需要:以編程方式將設備從縱向轉換爲兼容iOS6和iOS5的橫向。
問題:我不能在ios6上使用[UIDevice setOrientation]
函數。更改與ios6和ios5兼容的設備方向
我有:對iOS6的代碼:
- (BOOL) shouldAutorotate
{
return YES;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeLeft;
}
對於iOS5的代碼:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
所以,我需要寫上的iOS5旋轉代碼:
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
// [[UIDevice currentDevice] setOrientation] - I cannot use it
// ???
}