The title error is displayed when calling Uiimagepickercontroller to display the picture library.
Later found on the forum there is a solution to this problem, recorded as follows:
1. Adding this method to the appdelegate is OK.
#if __iphone_os_version_max_allowed >= __iphone_6_0
-(Nsuinteger) Application: (UIApplication *) application Supportedinterfaceorientationsforwindow: (UIWindow *) window
{
return uiinterfaceorientationmaskall;
}
#endif
If the program is not only support horizontal screen, but horizontal screen vertical screen is supported, then to 1 can be solved. However, if the program only supports horizontal screens, this workaround causes a problem:
All the interface can support the vertical screen, this is not what we want, then we need to add the following steps.
2. From
Uinavigationcontroller
Derive one of your own class Myrootviewcontroller:
There are several ways to add a class:
-(Nsuinteger) supportedinterfaceorientations
{
Returnuiinterfaceorientationmasklandscape;
}
-(BOOL) shouldautorotate {
return YES;
}
Override to allow orientations other than the default portrait orientation.
-(BOOL) Shouldautorotatetointerfaceorientation: (uiinterfaceorientation) interfaceorientation
{
Return YES for supported orientations
return (interfaceorientation = = Uideviceorientationlandscapeleft | |
Interfaceorientation = = uideviceorientationlandscaperight);
}
3. In the Laugth method for finding Appdelegate, replace with:
Create a Navigation Controller with the Director
Navcontroller_ = [[Myrootviewcontrolleralloc] initwithrootviewcontroller:director_];
Navcontroller_.navigationbarhidden =yes;
In the. h file, change the definition of Navcontroller_ to Myrootviewcontroller
4. This is the perfect solution. Thanks for the internet, thanks to Google.