У меня есть 5 просмотров в раскадровке. Я хочу, чтобы каждая ориентация вида была разной, например, один вид будет UIInterfaceOrientationLandscapeRight
, другой вид будет UIInterfaceOrientationLandscapeLeft
или UIInterfaceOrientationPortrait
или UIInterfaceOrientationPortraitUpsideDown
. Так как же установить эту ориентацию взгляда по-другому.
Я использовал [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
, но он показывает предупреждение «UIDevice может не отвечать на setOrientation». По мнению многих авторов stackoverflow, которые я использую
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
//return UIInterfaceOrientationLandscapeLeft;
return (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
}
этот код выше, но он не работает в моем проекте. Итак, какова правильная процедура ориентации экрана. Заранее спасибо.