IOS screen Adaptation

Source: Internet
Author: User

#define WIDTH cgrectgetwidth ([UIScreen mainscreen].bounds) #define HEIGHT cgrectgetheight ([UIScreen mainscreen]. bounds) #define SCREEN [UIScreen mainscreen].bounds#define Autosizescalex (width>480? width/320.0:1.0) #define Autosizescaley (width>480? height/568.0:1.0) #define Widthscale (autosizescalex*width/750.0) #define Heightscale (autosizescaley*height/1334.0)    Cg_inline Cgrectcglflmake (CGFloat x, cgfloat y, cgfloat width, cgfloat height) {cgrect rect;    rect.origin.x = x *autosizescalex;    RECT.ORIGIN.Y = y *autosizescaley;    Rect.size.width = width *autosizescalex;    Rect.size.height = height *autosizescaley; return rect;    Cg_inline Cgpointcgpointlflmake (CGFloat x, cgfloat y) {cgpoint pointlfl;    pointlfl.x = x * AUTOSIZESCALEX;    Pointlfl.y = y * Autosizescaley; return POINTLFL;}    Cg_inline cgsizecgsizelflmake (cgfloat width, cgfloat height) {cgsize sizelfl;    Sizelfl.width = width* Autosizescalex;    Sizelfl.height = height* Autosizescaley; return SIZELFL;} #define Fontscale 72.0/96.0 

IOS screen Adaptation

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.