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

Catch single atoms in a "trap" to measure the age of ice cores

The scientific expedition team drilled ice cores ...

ASO Optimization: When users search for APP, what are they searching for?

Introduction: With the rise of mobile Internet, A...

Share the tips on promoting products through Kuaishou live streaming!

How did a newbie who had just arrived complete mo...

Is the mask subsidy real? How to get mask subsidies on WeChat

A few days ago, a notice about "mask subsidi...

Forward SMS to a specified mobile number by keyword

Source code introduction Often we need to filter ...

Why do people drink ice beer when eating crayfish, but no one drinks ice liquor?

After a week of hard work, how do you plan to tre...

Why did Harry Potter kiss under the mistletoe?

Christmas is coming soon. If nothing unexpected h...

As a human being, is it shameful if we can't outrun a Tyrannosaurus Rex?

If you evaluate it in one sentence The plot of th...

Discussion on building iOS engineering framework elegantly and quickly

A concise and elegant iOS project directory can h...

Flink in-depth deployment of advanced development and case practice

Introduction to Flink in-depth deployment of adva...