fix landscape view of camera

This commit is contained in:
REIS Benjamin 2016-10-03 13:50:06 +02:00
parent 1a766237f6
commit fdea674773
2 changed files with 29 additions and 0 deletions

View file

@ -43,6 +43,20 @@
return self;
}
- (BOOL) shouldAutorotate{
return NO;
}
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
#else
- (UIInterfaceOrientationMask)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait;
}
#endif
#pragma mark - UICompositeViewDelegate Functions
static UICompositeViewDescription *compositeDescription = nil;
@ -93,6 +107,10 @@ static UICompositeViewDescription *compositeDescription = nil;
setStatusBarStyle:UIStatusBarStyleDefault]; // Fix UIImagePickerController status bar style change
[PhoneMainView.instance hideStatusBar:YES];
//Prevent rotation of camera
NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationPortrait];
[[UIDevice currentDevice] setValue:value forKey:@"orientation"];
}
- (void)viewWillDisappear:(BOOL)animated {

View file

@ -740,4 +740,15 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
[LinphoneManager.instance startLinphoneCore];
}
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
if ([[(PhoneMainView*)self.window.rootViewController currentView] equal:ImagePickerView.compositeViewDescription])
{
//Prevent rotation of camera
NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationPortrait];
[[UIDevice currentDevice] setValue:value forKey:@"orientation"];
return UIInterfaceOrientationMaskPortrait;
}
else return UIInterfaceOrientationMaskAll;
}
@end