简体   繁体   中英

App is not running retina in Xcode simulator

I got a project from my coworker, let's name it as ProjectB , The weirdest part of this project is when I run this project in iPhone 6, I can see it's not retina. I am trying to figure out how to make this project runs as retina. For test, I created an another empty project Demo . And then I copied a UITableViewController from ProjectB and paste it in the Demo project. When I run Demo , it's retina obviously. I make two snapshot from ProjectB and Demo to compare them:

Demo runs in simulator look like this 演示版 ProjectB runs in simulator look like this 项目B

As you can see, the cell looks fine in Demo but not good in ProjectB . I have set the layout constraint for their common UITableViewController. Both projects are using the same UITableViewController in a storyboard.

So, ProjectB definitely is not running as retina. I have looked the project setting, deployment target is iOS 7.0, runs in iPhone 6 simulator. What else should I look at?

The iPhone 6+ renders internally using @3x assets at a virtual resolution of 2208×1242 (with 736x414 points), then samples that down for display

In order to determine iphone 6+ screen in xcode , it is necessary have a picture Default-736h@3x.png

And remove Launch Screen file

Below is the list of launch image sizes and their corresponding filenames, again with iPhone 6/6 Plus bolded for reference:

Default.png: 320 x 480

Default@2x.png: 640 x 960

Default-568h@2x.png: 640 x 1136

Default-667h@2x.png: 750 x 1334 (iPhone 6, Portrait)

Default-736h@3x.png: 1242 x 2208 (iPhone 6 Plus, Portrait)

Default-Landscape-568h@2x.png: 1136 x 640

Default-Landscape-667h@2x.png: 1334 x 750 (iPhone 6, Landscape)

Default-Landscape-736h@3x.png: 2208 x 1242 (iPhone 6 Plus, Landscape)

Default-Portrait.png: 768 x 1024

Default-Portrait@2x.png: 1536 x 2048

Default-Landscape.png: 1024 x 768

Default-Landscape@2x.png: 2048 x 1536

Or use Launch Screen file @3x / @2x screens for 6 Plus/Phone 6

I just found out the launch screen is not set. And I figured not give it a try. And then I set select the launch screen. It worked. It is running retina.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM