Ios application screen compatibility

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.