iOS call system camera default is vertical screen, find a lot of ways to force the screen is invalid, the following code tested compatible IOS78
Customize a Uiimagepickercontroller and override the following methods:
-(uiinterfaceorientation) preferredinterfaceorientationforpresentation {
returnuiinterfaceorientationlandscapeleft;
}
-(nsuinteger) supportedinterfaceorientations{
returnuiinterfaceorientationmasklandscape;
}
-(BOOL) shouldautorotate {
returnYES;
}
-(BOOL) shouldautorotatetointerfaceorientation: ( uiinterfaceorientation ) interfaceorientation {
if(uiinterfaceorientationislandscape(interfaceorientation)) {
returnYES;
} else {
returnNO;
}
}
To be compatible with iOS8 you also need to add the following code to the delegate
-(nsuinteger) application: ( uiapplication *) Application Supportedinterfaceorientationsforwindow: (uiwindow *) window
{
NSString * Strsubclass = [nsstringstringwithutf8string:object_ GetClassName(window. Rootviewcontroller . Presentedviewcontroller )];
if ([@ "Imgtakeviewcontroller"isequaltostring: Strsubclass]) {
returnuiinterfaceorientationmaskall;
}
return [applicationSupportedinterfaceorientationsforwindow: Window];
}
Force horizontal screen for iOS camera interface