mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-26 03:20:50 +02:00
Force orientation to portrait only on phone
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user