Recently doing about iphone6,6+, and your adaptation to IOS8.
Make a summary here.
The implementation of the iOS multi-screen adaptation is designed in the following ways.
1, macro definition:
Principle: Get the width and height of the screen by defining the macro definition to dynamically position the size and position of the elements in the view.
Applies To: The screen size is small, the content displays single, satisfies the element to enlarge, shrinks and so on the more single presentation.
Cons: As the number of iphone devices grows, the size of the screen tends to diversify and the implementation of this approach becomes more complex. If the demand is, for different flat cloth size, the screen display of the content of different, different ways,
Such a requirement, the macro definition is quite complex to implement.
2, AutoLayout:
based on constraints: unlike previously defined frame positions and dimensions, the position of the AutoLayout is defined by the so-called relative position constraints, such as The X coordinate is the center of the Superview and the Y coordinate is the bottom of the screen
Top 10 Megapixels and so on.
Descriptive: the definition of constraints and the relationship of individual view are described using a visual language approach.
Layout system: The position of each element that is responsible for the interface.
Pros: It solves the problem of view adaptation in different resolutions and screen sizes, and simplifies the definition of the position of the view when rotating.
3, Sizeclass
principle: Size classes is actually the size of the iOS device screen is categorized, width and height are divided into 3 cases: compact, Rules (Regular), any ), where " any " contains tight( Compact), rule (Regular) type. 3x3 A total of 9 size, each size can set a specific set of layouts, if not specifically specified, the default is in (wide arbitrary, high arbitrary) mode is set, and the other 8 layouts inherit it. size classes is a further abstraction of the type of screen size.
Advantages: the advent of AutoLayout reduced the complexity of the layout to the view-view relationship, and then the frame was specified by the root view (i.e., the screen), and then all the sub-view relative layouts, the concept of the frame one to the root view frame, but with the size class, the frame concept of the root view is removed, and the entire app's UI and frame are out of relation, which is exactly what Apple wants to
To achieve the goal.
The simple expression by sizeclasses is as follows:
Iphone4s,iphone 5/5s,iphone 6
Vertical screen: (w:compacth:regular)
Horizontal screen: (w:compacth:compact)
Iphone6plus
Vertical screen: (w:compacth:regular)
Horizontal screen: (w:regularh:compact)
Ipad
Vertical screen: (w:regularh:regular)
Horizontal screen: (w:regularh:regular)
AppleWatch (guess)
Vertical screen: (w:compacth:compact)
Horizontal screen: (w:compacth:compact)
4.about the Picture:
Physical size resolution picture size
IPhone 3GS 320*480 320*480 @1x 3.5
IPhone 4, 4s 320*480 640*960 @2x 3.5
IPhone 5, 5s 320*568 640*1136 @2x 4.0
IPhone 6, 375*667 700*1334 @2x 4.7
iphone 6+ 408*736 1243*2208 @3xs 5.5
IOS8 screen adaptation issues.