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

It turns out there are things that will make you uglier the more you eat!

One minute with the doctor, the postures are cons...

Is the spring for “black taxis” coming?

It's easy to hate a city when you're in a...

C4D product performance first issue [HD quality with material]

C4D product performance first issue [HD quality w...

Everything you want to know about event planning and operation is here

As an operator , event planning and event operati...

Apple 'still investigating' three unpatched security flaws in iOS 15

In early September, security researcher Denis Tok...

How to deal with the situation when there are only a few APP downloads per day

If your app has been launched and follows the fol...