App thinks it works on a 3.5-inch iPhone when it is 4 inches

I am developing an application for 3.5 and 4 inch screens. However, suddenly on the simulator, the screen size became 320 * 480, even when I launch the 4-inch iPhone simulator.

I put this in the AppDelegate file and printed 320.000000, 480.000000 ...

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; NSLog(@"%f, %f", [[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height); ... } 

I am not sure which parameter in Xcode (if any) that I accidentally touched did so. All my .xib files are mounted on a 4-inch retina. Has anyone come across this before?

+7
ios cocoa-touch xcode
source share
2 answers

Please check that you have the Default-h568 file in the project for iPhone 4inches.

+11
source share

About the default applications created in Xcode 6.0, try the following:

Project Properties → Application Icons and Launching Images → Launching an Image Source → Using the Object Directory → Images, Migration

After this project will correctly display on 4-inch iOS 7 devices.

+1
source share

All Articles