mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 07:42:40 +00:00
Force orientation to portrait only on phone
This commit is contained in:
parent
08acf9d5fc
commit
dd5add280d
1 changed files with 30 additions and 0 deletions
|
@ -107,6 +107,12 @@
|
|||
[self.endCallButton setImage:hangUpButtonImage forState:UIControlStateNormal];
|
||||
[self.endCallButton setImage:hangUpButtonImage forState:UIControlStateHighlighted];
|
||||
|
||||
// force orientation to portrait if phone
|
||||
if ([UIDevice currentDevice].isPhone)
|
||||
{
|
||||
[[UIDevice currentDevice] setValue:[NSNumber numberWithInteger: UIInterfaceOrientationPortrait] forKey:@"orientation"];
|
||||
}
|
||||
|
||||
[self updateLocalPreviewLayout];
|
||||
|
||||
[self configureUserInterface];
|
||||
|
@ -152,6 +158,30 @@
|
|||
[super viewWillDisappear:animated];
|
||||
}
|
||||
|
||||
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
|
||||
{
|
||||
// limit orientation to portrait only for phone
|
||||
if ([UIDevice currentDevice].isPhone)
|
||||
{
|
||||
return UIInterfaceOrientationMaskPortrait;
|
||||
}
|
||||
return [super supportedInterfaceOrientations];
|
||||
}
|
||||
|
||||
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
|
||||
{
|
||||
if ([UIDevice currentDevice].isPhone)
|
||||
{
|
||||
return UIInterfaceOrientationPortrait;
|
||||
}
|
||||
return [super preferredInterfaceOrientationForPresentation];
|
||||
}
|
||||
|
||||
- (BOOL)shouldAutorotate
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
#pragma mark - override MXKViewController
|
||||
|
||||
- (UIView *)createIncomingCallView
|
||||
|
|
Loading…
Reference in a new issue