1
Я пытаюсь установить строку состояния в нужном ландшафте, когда она всегда находится в портретном положении. Я делаю что-то неправильно?iOS 8 Ориентация Пейзажная строка состояния
Или я могу запустить строку состояния в правой части экрана на определенной странице?
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
Я пробовал этот код, но он не работал.
.h
UIViewController *currentVC;
.m
- (NSUInteger)supportedInterfaceOrientations
{
NSUInteger orientations = UIInterfaceOrientationMaskLandscapeRight;
if (vertical)
{
orientations = UIInterfaceOrientationMaskPortrait;
}
if (horizontal)
{
orientations = UIInterfaceOrientationMaskLandscapeRight;
}
return orientations;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
- (BOOL)shouldAutorotate
{
NSLog(@"shouldAutorotate");
return YES;
}