Before ipone 4S, we didn't seem to think too much about screen compatibility, because iphone smart helped us solve it, for example, iphone 3g iphone 3gs for 320*480 iphone 4 iphone 4S for 640*960 we often provide a xx@2x.png if it's a Retina screen, iphone chooses a realistic @ 2x image for itself. The iphone 5 is 640x1136, 176 pixels higher than 4 and 4 s. If we consider screen compatibility, we can determine whether the iphone 5 is like this. If it is 5, we will do some special processing, for example, if it is 5, we will increase the size of the view, etc. # define isIPhone5 ([UIScreen instancesRespondToSelector: @ selector (currentMode)]? CGSizeEqualToSize (CGSizeMake (640,113 6), [[UIScreen mainScreen] currentMode]. size): NO) 2 directly use the ratio. When setting the size, we do not write the data to death, but only provide some proportions. # Define ScreenHeight [[UIScreen mainScreen] bounds]. size. height # define ScreenWidth [[UIScreen mainScreen] bounds]. size. width # define StateBarHeight 20 # define MainHeight (ScreenHeight-StateBarHeight) # define MainWidth ScreenWidth 3 autoLayout. 4. If there is an xib file, we can address different situations, create multiple xib files. For example, for some complex la S, we may need to build a horizontal, vertical, and xib for 5.