iPhone6 ​​resolution and adaptation

iPhone6 ​​resolution and adaptation

Resolution and pixels

Verified by the new Xcode6 simulator (resolution is pt, pixels are real pixels):

  1. iPhone5 resolution 320x568, pixels 640x1136, @2x
  2. iPhone6 ​​resolution 375x667, pixels 750x1334, @2x
  3. iPhone6 ​​Plus resolution 414x736, pixels 1242x2208, @3x (note that after rendering at this resolution, the image pixel resolution is proportionally reduced to 1080p (1080x1920))

PaintCode made several pictures to explain it very clearly.

Automatic adaptation

If not processed, it will be automatically stretched in equal proportions. If you print the screen frame in the old project, it will still be 320x568
Comparing the automatically adapted and *** adapted navigation bars, you can see the problem:

Because of the stretching, there will be some blur. The navigation bar is obviously larger than 64, but it is still much better than the 3.5-inch to 4-inch black border.
How to turn off the automatic adaptation solution? This is still the old idea, change the startup image:

In addition to changing the startup image, I have to say that you can use a xib to set the startup image in the new Xcode:

However, this xib cannot be associated with any code (cannot customize the View Class, cannot IBOutlet, cannot add Object), which can be understood as this xib is a screenshot. The advantage of this solution is that Size Classes can be used to layout this xib for different screens (if interested, you can read "Introduction to Size Classes")

About manual adaptation

As long as you manually specify the startup image or the xib, the screen resolution will become the expected size. All the codes in the old code that hard-code the frame value will be out of luck. If you adapt manually, you have to adapt everything. It is recommended not to make any changes before finding a feasible solution . The automatic adaptation solution does not affect the usage.

Facing iPhones with 4 resolutions, it is recommended to use Auto Layout + Image Assets to manage images of different resolutions + Interface Builder (xib+storyboard) to build UI. The performance of Size Classes in lower versions of iOS is unknown. If you want this manual adaptation solution, at least your project needs to be deployed on iOS6+. If you don't use AutoLayout, you will die miserably.

About Xcode 6

  1. The simulator path has been changed ~/Library/Developer/CoreSimulator/Devices/
  2. There is no iOS6 simulator in xcode6 anymore. It's time to convince everyone to give up iOS7-
  3. From now on, it is mandatory to support 64-bit when submitting to the App Store. It is time to sort out all the dependent third-party libs and update them to 64-bit

<<:  Android image smooth scrolling component Glide

>>:  Microsoft complains about Android phones: Stuck in the air

Recommend

Tujia.com's big data precision marketing solution!

Tujia.com Big Data Precision Marketing Solution P...

How much does it cost to join a home improvement app in Yuxi?

Why join the WeChat Mini Program Development Comp...

Dinosaurs are not completely gone. Look up if you don't believe me.

Dinosaurs are known to almost everyone. These pre...

40 Lectures on Brand Marketing Positioning

Perception is greater than fact, which is a topic...

Why You Should Try Full Stack

[[146504]] When programmers see the concept of fu...

How to improve brand loyalty through integrated marketing?

I will lead you to understand what marketing acti...

Why should you be careful of large livestock when driving to pastoral areas?

This article was reviewed by Chen Xiaokai, Associ...

Hearthstone: The iPad mini is undermined

Earlier this month, Hearthstone for iPad was first...

Who cut the budget?

One phenomenon is that nowadays, clients are incr...

Smartisan T2 review: Still unique, but not as nostalgic

No one would have expected that the battle in the...

Huamanlou System Course Training System (Fifth Phase) Including Indicators

Hua Manlou system course training system (fifth ph...