First, the question
During the process of writing iOS apps, I've been testing with the iphone Retina (3.5-inch) simulator, and everything looks normal, and the graph is as follows:
I use a pure code implementation in application development. The company provided a iphone4s, and I used it to test everything to show normal. The problem is that when I use the iPhone5 and iphone5s real-time tests, I find that my application is not covered with screen display on IPhone5 and iphone5s, but that there is a black on the top and bottom of the application screen, as follows:
Second, the settlement
Check the problem steps:
First, I began to carefully examine my code, found that in the whole project, there is no place in the screen height when the use of a fixed value of 480, are directly to get the screen size, and then set the screen size.
Second, check the project resources, confirm has added default.png, [email protected], [email protected] launch pictures and other resources.
Third, I began to search the Internet, to see if there is a similar problem, they are how to solve, and try to provide various methods of netizens (there is said that if the use of Xib, in the xib inside set the view of the automatic layout; If you use pure code, Manually set the UIView AutoLayout, ... ), and ultimately no results.
In the process, see a netizen because of this problem, caused by the release of the application was Apple rejected.
Solution:
1, I accidentally found that before I wrote the demo can be in the iphone5s of the normal display, I will create a new project, and then directly run, show normal, this time I was excited.
2, I carefully compare the similarities and differences between two projects, found that "the project configuration what is the same", the inner wonder, no problem.
3, finally found that the configuration of a project is this, as follows:
Previously written demo project configuration such as:
Writing here, I think everyone has understood that the cause of the problem is where, yes! Only need to put launch image is configured as the following image of the option can be, specific operations such as:
Drag and drop the prepared picture into the corresponding box in the Launchimage, delete the original App,clean project on the phone, and re-run it!
There are black bars underneath the Xcode simulator