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

Xu Yuan's observation: The logic of China's monetary policy

Xu Yuan's Observation: The Logic of China'...

How to operate a Douyin corporate account without experience and manpower?

With the rise of short video platforms, more and ...

Hard constraints on software development

When checking out at a supermarket, the cashier w...

Inventory of customer acquisition channels for Internet advertising!

Whether it is a service or a physical product, on...

Establishing four strategic systems for user operations

What is the user operation system like? I believe...

"Dive" into deep water at night to explore the splendor of ancient marine life

Produced by: Science Popularization China Produce...

Tesla recalls some Model X vehicles in China due to safety risks

Not long ago, Tesla issued a voluntary recall not...