The adaptation of iOS7 has been a hot topic for many iOS Developers since the release of iOS7. There are also different opinions on this issue on the Internet. Some say this is the Xcode5 iOS7SDK bug, but apple does not admit it as a bug, and stipulates that newly released applications must be adapted to iOS7, otherwise they will never be released... Mark... It's so hard...
There are many articles on iOS7 screen adaptation on the Internet. When I first adapted iOS7, I also made many detours and encountered many amazing problems. For example, you may have adapted the image, but when you call the camera function to bring up the IMageViewController, there will be a strange problem.
There are two solutions for iOS7 adaptation:
1. completely hide the status bar. But the cost is that if your application uses a navigation bar, you must take this into consideration.
2. the status bar is displayed.
I will mainly talk about the second solution:
Add the following code to AppDelegate:
If ([[[UIDevicecurrentDevice] systemVersion] floatValue]> 6.1 ){
// Set the frame of the window based on the screen size.
If (ScreenHeight = 480 ){
Self. window. frame = CGRectMake (320,460 );
} Else if (ScreenHeight = 568 ){
Self. window. frame = CGRectMake (320,548 );
}
}
Then add the following code to the View Controller to be adapted:
# Pragma mark -- iOS7 & iOS6 adapter --
-(UIStatusBarStyle) preferredStatusBarStyle
{
ReturnUIStatusBarStyleLightContent;
}
-(BOOL) prefersStatusBarHidden
{
Return NO;
}
This completes the adaptation of iOS7, and does not invalidate the adaptation because the ImageViewController is called. Hope to help you... Go to the technical exchange group... You are welcome to join iOS developers. QQ technical exchange Q & A group: 209476515